Boost logo

Boost :

Subject: [boost] [In_Place_Factory] Typo
From: Manuel Jung (gzahl_at_[hidden])
Date: 2008-09-12 06:39:53


Hi,
I found a typo:
Here:
http://www.boost.org/doc/libs/1_36_0/libs/utility/in_place_factories.html
Chapter: Framework
In the First example:

struct C
{
   template<class InPlaceFactory>
   C ( InPlaceFactory const& aFactoty ) //<----------Here! should
be "aFactory"
    :
    contained_ ( uninitialized_storage() )
   {
     aFactory.template apply<X>(contained_);
   }

  ~C()
  {
    contained_ -> X::~X();
    delete[] contained_ ;
  }

  char* uninitialized_storage() { return new char[sizeof(X)] ; }

  char* contained_ ;
} ;

void foo()
{
  C c( in_place(123,"hello") ) ;
}

Greetings
Manuel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk