Boost logo

Boost :

From: SourceForge.net (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:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1646100&group_id=7586

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.

--Clive.
  (clive-nospam-boost.org_at_[hidden])

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1646100&group_id=7586

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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