i'm 1st time trying boost lib and don't know how to assign map of string and share pointer. here is my code and i'm trying to assign value but not able to do it.
#include <boost\shared_ptr.hpp>
#include <boost\assign.hpp>
#include <boost\map.hpp>
struct X
{
public:
int p;
double q;
X();
~X();
};
struct Y
{
float m;
double n;
Y();
~Y();
};
struct Z
{
public:
std::map<std::string,boost::shared_ptr<X>> Xtype;
std::map<std::string,boost::shared_ptr<Y>> Ytype;
int i;
string name;
Z();
~Z();
};
struct X *x1;
struct Y *y1;
void setx()
{
x1->p=10;
x1->q=20.20;
}
void sety()
{
y1->m=10;
y1->n=20.20;
};
void initialize(Z *z1)
{
z1->i=30;
// how to i add x1 and y1 to Xtype and Ytype respectively of z1 struct
}
my question :- how do i assign x1 and y1 value to Xtype and Ytype of z1 type. really do not know what to do and how to start. If i'm able to assign then i can move ahead to do serialization of it.