std::unique_ptr usage
·1 min
If you’re new to C++11, this post on Stackoverflow answers the question “How do I pass a unique_ptr
argument to a constructor or a function?” going through each case:
- by value
- by non-const l-value reference
- by const l-value reference
- by r-value reference