Boost logo

Boost :

Subject: [boost] [compressed_pair] [hof] [hana] What's the story with compressed_pair?
From: Tom Westerhout (kot.tom97_at_[hidden])
Date: 2018-05-30 11:10:19


Hello!

It looks like there are at least three different implementations of a
"std::pair with EBO" in Boost:

boost/utility/compressed_pair.hpp
boost/hof/detail/compressed_pair.hpp
boost/hana/pair.hpp

Finally, there is also std::tuple which seems to also make use of EBO. I
need similar functionality for a GSoC project I'm working on this
year. So I'm wondering, is compressed pair considered a simple
technicality that should be implemented from scratch every time I need
it or shall I stick to one of the four mentioned implementations?

I would much prefer to use Boost.Utility's one, but unfortunately it's
neither constexpr-friendly nor noexcept-friendly... Is there some reason
why it cannot be annotated with macros which expand to constexpr and
noexcept when compiled with C++11 support? Or has no one just gotten
around to do it?

Thanks in advance,
Tom


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