Guest User

Untitled

a guest
Jan 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. template<class Container,class T>
  2. void insert_into_pos( Container &c, size_t pos, T obj )
  3. {
  4. if( pos >= c.size() ) throw std::runtime_error( "invalid position" );
  5. c.insert( std::next( c.begin(), pos ), std::move( obj ) );
  6. }
Add Comment
Please, Sign In to add comment