Boost C++ Libraries: Ticket #818: No zero-argument in_place() https://svn.boost.org/trac10/ticket/818 <pre class="wiki">There is no zero-argument version of boost::in_place(). I would have expected this to exist, and to be a factory for a type's default constructor. This is necessary when attempting to use boost::optional with a type that is not CopyConstructible, or where the copy constructor is expensive: #include &lt;boost/optional.hpp&gt; #include &lt;boost/utility/in_place_factory.hpp&gt; boost::optional&lt;my_type&gt; my_optional; my_optional = boost::in_place(); I'm not aware of any other way to initialise a boost::optional to a default-constructed instance without unnecessary and perhaps impossible copying. --Clive. (clive-nospam-boost.org@nsict.org) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/818 Trac 1.4.3 anonymous Fri, 14 Sep 2007 02:36:25 GMT <link>https://svn.boost.org/trac10/ticket/818#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/818#comment:1</guid> <description> <p> There is an implementacion of place with zero-argument in <a class="ext-link" href="http://www.boost-consulting.com/vault/index.php?direction=0&amp;order=&amp;directory=Utilities"><span class="icon">​</span>http://www.boost-consulting.com/vault/index.php?direction=0&amp;order=&amp;directory=Utilities</a> </p> <p> The poly_obj.tar.gz contains the file poly_obj.hpp and it´s there an in_place with zero-argument. It runned OK in my system. Anyone could check it out and put in release? Thanks.. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Fernando Cacciola</dc:creator> <pubDate>Fri, 02 Nov 2007 23:29:36 GMT</pubDate> <title>status, resolution changed; severity, milestone set https://svn.boost.org/trac10/ticket/818#comment:2 https://svn.boost.org/trac10/ticket/818#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.35.0</span> </li> </ul> <p> The improved version contributed by Tobias Schwinger (which allows zero-argument factories) is now on the trunk. The docs still need to be updated though. </p> Ticket