On Oct 11, 11:59 pm, Sebastian Karlsson
> The problem for me is that I need a unique ID which I
> can serialize to be able to later on de serialize from a base pointer,
> it's the same problem which boost::serialize have pretty much.
Then why not define it yourself?
You could make something like:
template
static const char* const name;
};
and define
template<> serialization_traits
template<> serialization_traits
template<> serialization_traits
template<> serialization_traits
"SomeNamespace::SomeClass";
...
This will allow you to define traits only when you need them (and
maybe for basic types) so there is no overhead, and allow you to
control the names given as much as you like (you might want to define
names following a different notation or skipping namespace alltogether
in some cases).
> The gains from a standardized name() would mainly be for data sharing
> between the same application compiled for different platforms.
What if the compilations for different platforms use different byte
alignments? How do you serialize between different architectures
(32bit vs. 64bit)?
I "feel" you're better of with more micromanaging of the serialization
process (but maybe I misunderstood something).
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Why the decision to leave typeinfo::name() out of the standard?