Hi Kind-DaniWebbers,
How do you initialise a boost::archive:binary_oarchive in a different place to where you declare it?
So:
class CBase {
std::ofstream m_ofs;
boost::archive:binary_oarchive m_binOA(); // <== default constructor
virtual void Open(std::string& s) = delete;
};
class CDerived : CBase {
void Open(std::string& s) override
{
CBase::m_ofs("filename.bin", std::ios::binary);
CBase::m_binOA(CBase::m_ofs, /*flags*/); // <== says error C2660: '...'::m_binOA' :
// function does not take 2 arguments
}
};
I am trying to create different interfaces for XML, TXT and BIN. So I just derive from the one I want. Is this the way to do it? I struggling to design this. Please can I have some help.
Thanks.