Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2007-01-27 14:30:24

Bugs item #1646100, was opened at 2007-01-27 11:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: No zero-argument in_place()

Initial Comment:
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 <boost/optional.hpp>
    #include <boost/utility/in_place_factory.hpp>

    boost::optional<my_type> 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.



You can respond by visiting:

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at