Listing 2: Iterator range insertion.

for each element, e, in the range (first, last]
   search the tree for a place to insert e
   if e is not already in the tree
      allocate a new node, n
      try
         call n's constructor
      catch
         deallocate n
         rethrow the exception
      add n to the tree