mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-18 10:06:54 +01:00
23303c1c4f
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@232 f6dd340e-d3f9-0310-b409-bdd246841980
9 lines
368 B
Text
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"));
|
|
)
|