[Serialization] is_serializable trait?
Hi, I know there is the tracking level trait. Is that sufficient to be able to say that T is serializable? struct T { T(some_stuff); private: some_non_default_constructing_members; }; In this case, I think tracking level will be set to track selectively but its not serializable as is. Thanks, Sohail
a type is serializable if its a primtive or it has a serialize function. Robert Ramey Sohail Somani wrote:
Hi,
I know there is the tracking level trait. Is that sufficient to be able to say that T is serializable?
struct T { T(some_stuff); private: some_non_default_constructing_members; };
In this case, I think tracking level will be set to track selectively but its not serializable as is.
Thanks,
Sohail
How can you determine (compile-time) that a class has a serialize function?
struct foo {
template <typename Archive>
void serialize (Archive &, const unsigned int);
};
"&foo::serialize" isn't a type and I can't figure out a way to make it
a type (besides a typedef in the class) and also a constant
expression.
Tried to play around with this as well but theres no substitution
failure here and static functions can't be constant expressions
(commonnnn c++0x!!)
struct serialize {
template <typename T>
static void value(T const&) { void(T::*f)(archive::xml_oarchive &,
const unsigned int) = &T::template serializearchive::xml_oarchive;
(void)f; }
};
Basically, in the code below I want to see "GoodGood" printed out and
the only thing I can change is Q.
struct A{
void f(int,int){}
};
struct B{};
template
a type is serializable if its a primtive or it has a serialize function.
Robert Ramey
Sohail Somani wrote:
Hi,
I know there is the tracking level trait. Is that sufficient to be able to say that T is serializable?
struct T { T(some_stuff); private: some_non_default_constructing_members; };
In this case, I think tracking level will be set to track selectively but its not serializable as is.
Thanks,
Sohail
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Chris Fairles
-
Robert Ramey
-
Sohail Somani