[xsd-users] XML C++ Data Binding

Boris Kolpackov boris at codesynthesis.com
Tue Feb 9 15:48:05 EST 2010


Hi Sumant,

Sumant Tambe <sutambe at dre.vanderbilt.edu> writes:

> Is it possible to configure cxx-tree to use STL containers instead of  
> xsd::cxx::tree::sequence?

No, this is not possible. STL containers store elements by value which 
would be too inefficient for C++/Tree. Instead, the tree::sequence 
container (which, BTW, conforms fully to the STL sequence interface and 
therefore can be used anywhere std::vector can) stores simple types by 
value and more complex -- as pointers to dynamically-allocated objects. 
The iterator provided by tree::sequence hides all this and allows you
to access all the objects uniformly as references (i.e., when you have 
*i, you get T& regardless of whether T is simple or complex).

The simple type specialization of tree::sequence simply derives from
std::vector. The complex type specialization uses std::vector in its
implementation.

Boris



More information about the xsd-users mailing list