move-semantics
C++11 File Streams
Has开发者_Go百科 C++11 move semantics made the use of std::ifstream and std::ofstream easier or safer with regards to exceptions? I guess it depends on the standard library aswell. Any differences the[详细]
2023-04-10 15:17 分类:问答Move Semantics and R-Value References in C++ String Construction
Will C++11 move semantics and r-value refe开发者_开发百科rences in argument string constructs such as[详细]
2023-04-10 03:02 分类:问答Proper way to implement move semantics for class with std::vector of std::vector member
I have a class that has a member which is a vector of vectors. I would like to write a constructor for this class that takes an r-value reference to a single vector as an argument, and moves it into t[详细]
2023-04-09 05:31 分类:问答Store pointers or objects in classes?
Just a design/optimization question.When do you store pointers or objects and why?For example, I believe both of these work (barring compile errors):[详细]
2023-04-05 02:58 分类:问答Initializer-list-constructing a vector of noncopyable (but movable) objects
One can push_back rvalues of a noncopyable-but-movable type into a vector of that type: #include <vector>[详细]
2023-04-01 01:14 分类:问答Is parameter binding sequenced after argument evaluation?
Suppose I have the following function: void foo(std::vector<int> vec, int n); If I call the function like this:[详细]
2023-04-01 00:12 分类:问答C++11 overload of `M operator+(M&&,M&&)`
Update: clarification, more clear focus and shortened example: Can I circumvent the M op+(M&&,M&&) overload? Assuming, I want good handling of RValues? I guess the other three overlo[详细]
2023-03-30 14:55 分类:问答What can I do with a moved-from object?
Does the standard define precisely what I can do with an ob开发者_运维知识库ject once it has been moved from? I used to think that all you can do with a moved-from object is do destruct it, but that w[详细]
2023-03-27 03:46 分类:问答Are moved-from objects required to be destructed?
If I move-construct a from b, is it still necessary to destruct b, or can I get away without doing so?[详细]
2023-03-25 17:52 分类:问答Storing noncopyable (but movable) object in std::pair
I am trying to store a noncopyable (but movable) object inside an std::pair, as follows: #include <utility>[详细]
2023-03-22 10:04 分类:问答