c++ - Wrapped reference-counting, questions about move-semantics -
i'm working on class acts scope helper reference-counted objects. interface should allow use class follows:
{ handle<string> s = handle<string>::new("hello, world!"); s = s->concat(handle<string>::new(" name peter")); }
while string
class contains reference-count.
i not familar move semantics , unable find concrete paper sates conditions apply move-semantics. basically, wondering is:
can this
object initialized in move-constructor? because if case, can't tell apart if member in handle
class points string
contains garbage value or pointing real string
.
i guess it's possible using placement construction, doing asking trouble. don't know why mentioned it. short answer: no, cannot. move constructors differ other constructors in type of values accept.
Comments
Post a Comment