rvalue-reference
C++0x: rvalue reference versus non-const lvalue
When programming in C++03, we can\'t pass an unnamed temporary T() to a function void foo(T&);.The usual solution is to give the temporary a name, and then pass it like:[详细]
2023-02-01 04:15 分类:问答Make callback accept temporary on VS 2010
I have a callback implementation using rvalue references to store arguments that works fine with gcc, but fails to compile in VS 2010 on some code. A short version:[详细]
2023-01-31 09:54 分类:问答Best form for constructors? Pass by value or reference?
I\'m wondering the best form for my constructors. Here is some sample code: class Y { ... } class X { public:[详细]
2023-01-28 06:23 分类:问答Strange problem with conversion
In code below: template<class Key, class Value> class Pair { private: std::pair<Key,Value> body_;[详细]
2023-01-26 21:13 分类:问答Does D have something akin to C++0x's move semantics?
A problem of \"value types\" with external resources (开发者_Python百科like std::vector<T> or std::string) is that copying them tends to be quite expensive, and copies are created implicitly in[详细]
2023-01-25 05:16 分类:问答Passing non-const references to rvalues in C++
In the following line of code: bootrec_reset(File(path, size, off), blksize); Calling a function with prototype:[详细]
2023-01-23 19:42 分类:问答Calling base class move ctor [C++0x]
Which is the right way to call base class move ctor? thi开发者_运维百科s (works in MSVC2010, but not in CBuilder2010):[详细]
2023-01-22 16:40 分类:问答C++0x: conditional operator, xvalues, and decltype
I am reposting a comp.std.c++ Usenet discussion here because that group has become very unreliable. The last few posts I\'ve submitted there have gone into the void, and activity has all but ceased. I[详细]
2023-01-19 08:42 分类:问答style in binding a reference to object-or-dummy
What is the best way to bind an rvalue reference to either a given object or a temporary copy of it? A &&var_or_dummy = modify? static_cast<A&&>( my_A )[详细]
2023-01-19 03:16 分类:问答Move constructor (rvalue reference) in implicit conversion
I am upgrading a C++ project from MSVC 2008 to 2010, and because of the new CComBSTR move constructor [CComBSTR( CComBSTR&& )], I am getting a compiler error because of an ambiguous call.[详细]
2023-01-16 10:45 分类:问答