↧
Answer by JaMiT for Why do C++ sequence containers have an "assign" method...
In particular, my initial guess for why sequence containers have assign is it avoids creating a temporary in the applicable circumstance, but the same reasoning would apply to the associative...
View ArticleWhy do C++ sequence containers have an "assign" method but associative...
The C++ sequence containers(vector, forward_list, list, and deque)all have an assign method. For example, std::vector has(quoting cppreference.com):void assign( size_type count, const T& value...
View Article