[xsd-users] C++ 11 move semantics

Ovanes Markarian om_codesynthesis at keywallet.com
Thu Jun 27 07:56:31 EDT 2013


Now I run into the issue where I use a unique point from the C++ 11
standard with xsd 3.3.0 and that obviously fails :( since internally an
l-value is generated from r-value.

Here an example:

One of my parsers returns:

std::unique_ptr<what_ever_type>


The base parser skeleton has the following construct:

                std::unique_ptr<what_ever_type> tmp
(this->Underlying_parser_->post_WhatEverType());
                this->WhatEverType (tmp);

Here I need to either use an explicit move: std::move(tmp) or pass the
r-value to the WhatEverType function:

                std::unique_ptr<what_ever_type> tmp
(this->Underlying_parser_->post_WhatEverType());
                this->WhatEverType (std::move(tmp));

or

this->WhatEverType(this->Underlying_parser_->post_WhatEverType())


Is there any work around for that? Can I specify in a type-map file a move
function to be used. Or do I really need to write a wrapper type, which
will accept the unique_ptr and move it implicitly for me?


Many thanks,
Ovanes

P.S: I would not like to deal with deprecated auto_ptr.


More information about the xsd-users mailing list