Is there a difference between using .begin() vs .end() for std::inserter for std::set?

In practice, not much. If you’re inserting a large number of already in order elements into an empty set, the second will be somewhat faster, but that’s about it. std::insert_iterator calls insert with the iterator; std::set interprets it as a hint, and inserts in constant time (rather than lg n) if the insertion is immediately before the hint. (Actually, if the set is empty, I think both will do exactly the same thing.)

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.