cppannotations/yo/stl/sharedmove.yo
Frank B. Brokken 23303c1c4f Flaws removed
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@232 f6dd340e-d3f9-0310-b409-bdd246841980
2009-07-15 15:52:54 +00:00

9 lines
368 B
Text

A tt(shared_ptr) may also be initialized by an r-value reference (a temporary
value) initialized an returned by a function. E.g.,
verb(
std::shared_ptr<std::string> &&makeString(char const *text)
{
return std::move(shared_ptr<string>(new std::string(text)));
}
std::shared_ptr<std::string> shared(makeString("hello world"));
)