[xsd-users] list construction from std::iterators.

david.r.moss at selex-comms.com david.r.moss at selex-comms.com
Tue Jun 26 12:32:09 EDT 2007


Boris,

Can you construct a list type using std::iterators (cxx-tree-manual 2.6.3 
"Practically, this means that you can treat such a sequence as if it
was std::vector"). If not, is there an alternative?

I'm using xsd-3.0.0.b2-i686-windows. I don't think this working depends on 
any command line arguments?!

The sequence<X> base class seems to have the required interface but not 
the list class that derives from it.

See attached schema and the following:

// Setup some input as a vector.
vector<string> v;
{
  v.push_back("one");
  v.push_back("two");
}
 
// Standard vector construction from iterators -- ok.
vector<string> y( v.begin(), v.end() );

// list-type construction -- not ok; no valid constructor.
string_list_t nl( v.begin(), v.end() );

// Especially useful where an object wants the data on construction!
object_t o( string_list_t( v.begin(), v.end() ) );



Cheers,
Dave.

Dave Moss 
SELEX Communications 
Grange Road 
Christchurch 
Dorset  BH23 4JE 
United Kingdom 
Tel: + 44 (0) 1202 404841 
Email: david.r.moss at selex-comms.com 


------------------------------------------------------------
This email and any attached files contains company confidential information which may be legally privileged. It is intended only for the person(s) or entity to which it is addressed and solely for the purposes set forth therein.  If you are not the intended recipient or have received this email in error please notify the sender by return, delete it from your system and destroy any local copies.  It is strictly forbidden to use the information in this email including any attachment or part thereof including copying, disclosing, distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common law) for damage or breach arising or related to this email including but not limited to viruses and libel.
SELEX Communications Limited is a Private Limited Company registered in England and Wales under Company Number 964533 and whose Registered Office is Marconi House, New Street, CHELMSFORD, Essex. CM1 1PL. England.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-construction-test.xsd
Type: application/octet-stream
Size: 360 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070626/ad1c6b4c/list-construction-test.obj


More information about the xsd-users mailing list