
Pooyan Dadvand wrote:
...
So how about one of the following?
struct extradata { ... };
std::pair<VariableData, extradata> m_x std::pair<VariableData &, extradata&> m_x std::pair<VariableData *, extradata*> m_x std::pair<VariableData*, extradata &> m_x ... ar << m_x;
Can you please explain me more the idea of extradata structure? Consider that my extradata can be a double, ublas::vector, or even std::vector<weak_ptr<Element> > or any new type of variables. I have:
std::vector<std::pair<VariableData, extradata> > mData ... ar << mData;
and each element of vector can have a different type of data with different size or even have pointers. (It's a heterogeneous container) In this situation I don't know how to implement the extradata structure without knowing the type of variable I'm storing in it.
You must have some means to determine what that void* is pointing to when you access is from elsewhere in your application. I think Robert is suggesting that you implement extradata(and it's derivative)'s serialize method using that same scheme. Jeff