KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I use std::make_tuple if the execution order of the constructors is important? For example I guess the execution order of the constructor of class A and the constructor of class B is undefined for: std::tuple<A, B> t(std::make_tuple(A(std::cin), B(std::cin))); I came to that conclusion after reading a comment to the question Translating a std::tuple into a template parameter pack that says that this template<typename... args> std::tuple<args...> parse(std::istream &stream) { return std::make_tuple(args(stream)...); } implementation has an undefined execution order of the constructors. Update, providing some context: To give some more background to what I am trying to do, here is a sketch: I want to read in some serialized objects from stdin with the help of CodeSynthesis XSD binary parsing/serializing. Here is an example of how such parsing and serialization is done: example/cxx/tree/binary/xdr/driver.cxx xml_schema::istream<XDR> ixdr (xdr); std::auto_ptr<catalog> copy (new catalog (ixdr)); I want to be able to specify a list of the classes that the serialized objects have (e.g. catalog, catalog, someOtherSerializableClass for 3 serialized objects) and store that information as a typedef te
Tags (comma-separated)
Save Edits
Cancel