[committed] libstdc++: Add __maybe_const_t and __maybe_empty_t aliases

Pilar Latiesa pilarlatiesa@gmail.com
Mon Mar 2 08:33:00 GMT 2020


> It would be possible to implement those range adaptors so that the two
> base subobjects could be at the same address, and so sizeof(Wtf) would
> be smaller.

Would:
  template<bool _Present, typename _Tp, typename _Empty = decltype([]{})>
    using __maybe_present_t = std::conditional_t<_Present, _Tp, _Empty>;
work?

It appears to work, but I'm not sure this is allowed by [temp.res/8.5].



More information about the Libstdc++ mailing list