Boost logo

Boost Users :

Subject: [Boost-users] [Q] piecewise_construct for boost::container::map::emplace()
From: dave m. (boost_at_[hidden])
Date: 2016-04-05 12:20:38


I recently tried (but failed) to use boost::container::map::emplace()
with the piecewise_construct tag to forward constructor args as tuples.
After some fiddling around, it appears that piecewise_construct is not
implemented for boost::container::detail::pair (see
boost/container/detail/pair.hpp:151). I couldn't find any discussion in
the mailing list archives.

Is there a good reason not to use emplace() this way, or unreasonable
difficulty in implementing piecewise_construct for pair<U,V>?

(I ended up making constructors for my K, V elements that take tuples<>,
so emplace() is working for me, but I'm not completely sure that I have
avoided all possible copy/move operations. Using gcc-4.9.2, fwiw.)

Thanks,
dhm


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net