B
Bit Byte
Suppose I have a data variable defined thus:
typedef std::vector<std:air<std::string,std::string> > InfoVector ;
I have written a template function to generalize serialization:
template <class T> std:stream& Serialize(std:stream& out, const T&
value)
{
out.write(reinterpret_cast<const char*>(&value), sizeof(T)) ) ;
}
Can I pass InfoVector to my template function (or do I need a partial
specialized template ?). Any clarification on this issue will be very
helpful
typedef std::vector<std:air<std::string,std::string> > InfoVector ;
I have written a template function to generalize serialization:
template <class T> std:stream& Serialize(std:stream& out, const T&
value)
{
out.write(reinterpret_cast<const char*>(&value), sizeof(T)) ) ;
}
Can I pass InfoVector to my template function (or do I need a partial
specialized template ?). Any clarification on this issue will be very
helpful