I need to copy std::vector into std::stack.
-
Is traversing over vector and pushing into stack is only the way?
-
If there is another way what is better choice from performance point of view?
std::stack<A> m_stack; std::vector<A> m_vec; for (auto& elem : m_vec) { m_stack.push(elem); }
Aucun commentaire:
Enregistrer un commentaire