August 2017
Intermediate to advanced
438 pages
14h 19m
English
Now, we have a movable, but non copyable, class that can be used even on C++03 compilers and in Boost.Containers:
#include <boost/container/vector.hpp> #include <your_project/descriptor_owner_movable.h>int main() { // Following code will work on C++11 and C++03 compilers descriptor_owner_movable movable; movable = construct_descriptor3(); boost::container::vector<descriptor_owner_movable> vec; vec.resize(10); vec.push_back(construct_descriptor3()); vec.back() = boost::move(vec.front()); }
Unfortunately, C++03 standard library containers still won't be able to use it (that is why we used a vector from Boost.Containers in the previous example).
Read now
Unlock full access