Optional's Assignment fixed

[SVN r28412]
This commit is contained in:
Fernando Cacciola 2005-04-22 13:28:34 +00:00
parent aca7699046
commit 5ca5b4102b

View File

@ -117,9 +117,6 @@ From the user POV, it amounts to creating the right factory object to hold the p
The following simplified example shows the basic idea. A complete example follows the formal specification of the framework:</p>
<pre>struct C
{
C() : contained_(0) {}
C ( X const& v ) : contained_ ( new X(v) ) {}
template&lt;class InPlaceFactory&gt;
C ( InPlaceFactory const& aFactoty )
:
@ -128,11 +125,15 @@ The following simplified example shows the basic idea. A complete example follow
aFactory.template apply&lt;X&gt;(contained_);
}
~C() { delete contained_ ; }
~C()
{
contained_ -> X::~X();
delete[] contained_ ;
}
X* uninitialized_storage() { return static_cast&lt;X*&gt;(new char[sizeof(X)]) ; }
char* uninitialized_storage() { return new char[sizeof(X)] ; }
X* contained_ ;
char* contained_ ;
} ;
void foo()