Hello,

I am trying to implement the scapegoat tree provided by the boost::intrusive library, and in the example code, it first inserts the object into a vector and then into the scapegoat tree. Specifically, I am looking at the following part (modified some just to show the parts that I would be using):
Code:
   typedef sg_set
   < MyClass, compare<std::greater<MyClass> >, floating_point<false> >   BaseSet;
   typedef std::vector<MyClass>::iterator VectIt;

   for(int i = 0; i < 100; ++i)  values.push_back(MyClass(i));

   BaseSet baseset;
   
   //Now insert them in the reverse order in the base hook sg_set
   for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
      baseset.insert(*it);
   }
In this code, it inserts an iterator in the scapegoat (baseset). What if I don't want to create the vector first? Is it possible to create a one object iterator? I don't want to create the vector first because I already have the object ready to go and be inserted, I figure that it is wasted storage/cpu cycles to first insert into a vector if the only purpose of that vector is then to be inserted into a different list.

Thanks,
Justin