Repository navigation
rvalue
The most important thing to remember is that value categories are a taxonomy of expressions. They are not categories of objects or variables or types.
expression
glvalue - has identity (Addressable)
lvalue - Can be moved from = NO
xvalue - Can be moved from = YES - (expiring value)
rvalue - no identity (Not addressable)
xvalue - Can be moved from = YES
prvalue - Can be moved from = YES - (pure rvalue)
properties those expressions
- has identity (Addressable, persistent object in memory) - no identity (Not addressable)
- Can be moved from
https://medium.com/@barryrevzin/value-categories-in-c-17-f56ae54bccbe https://medium.com/@sagar.necindia/c-11-understand-value-categories-c9306976bfda https://habr.com/ru/articles/479342/ https://en.cppreference.com/cpp/language/value_category
lvalue reference -> lvalue const lvalue reference -> rvalue rvalue reference -> rvalue only !!! unversal reference - ?
std::move - cast lvalue to rvalue std::forward
Simple Forwarding Perfect Forwarding
https://habr.com/ru/articles/869854/
- A() = default;
- A(const A&) = delete; https://www.geeksforgeeks.org/cpp/explicitly-defaulted-deleted-functions-c-11/
https://www.fluentcpp.com/2019/04/19/compiler-generated-functions-rule-of-three-and-rule-of-five/
move operations include:
- move constructor
- move assignment operator
DArray(DArray &&other) noexcept DArray& operator=(DArray&& other) noexcept
Move operations may be explicitly specified or implicitly generated.
https://medium.com/@candyreddh/modern-c-insights-the-generation-of-special-member-functions-7733d578cc0a Since the C++ 11, there are 6 special member functions which may be generated by the compiler. They are:
- default constructor
- copy constructor
- copy assignment
- move constructor
- move assignment
- destructor
https://en.cppreference.com/cpp/language/copy_assignment
https://www.youtube.com/watch?v=Oma4Ag-snE4&list=PLaSMZtEVIQLfkQ5rV839mtFUXXNTgiGAx&index=8 https://www.youtube.com/watch?v=QSIBUblx0J0&list=PL9aFcBWVu5htdYy3scDw9oNdw9Lrff59S&index=1 https://www.youtube.com/watch?v=x5am_9qCMLQ
My footer
My side bar