Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class Container,class T>
- void insert_into_pos( Container &c, size_t pos, T obj )
- {
- if( pos >= c.size() ) throw std::runtime_error( "invalid position" );
- c.insert( std::next( c.begin(), pos ), std::move( obj ) );
- }
Add Comment
Please, Sign In to add comment