ngraph
ngraph copied to clipboard
WTF is up with emplace_back
Why does the vector.emplace_back we are using require that objects emplaced need a copy/move constructor. The object is supposed to be placement newed into the vector so a copy/move is not required.
http://en.cppreference.com/w/cpp/container/vector/emplace_back
The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container.
vector requires a copy constructor in order to grow the size of the vector. emplace_back does not inherently require copy but vector does.
https://stackoverflow.com/a/34543871