I am not using any heap allocation in my code, any benefit of using move semantics?
Should I be even move-ing anything?
template <typename TIterator1, typename TIterator2>
constexpr TIterator2 move(TIterator1 sb, TIterator1 se, TIterator2 db)
{
while (sb != se)
{
*db = std::move(*sb); // move instead of copy
++db;
++sb;
}
return db;
}
Not sure how move semantics work on static memory, as all I keep seeing is that its good for moving big heap objects.
New contributor
Xigi Schul is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.