On Tue, 2 Apr 2024 at 18:00, Pilar Latiesa wrote: > > Just out of curiosity: would this also work? > > template<typename _Tp, typename _Disc> > struct _Absent {}; > > template<bool _Present, typename _Tp, typename _Disc = decltype([]{})> > using __maybe_present_t = __conditional_t<_Present, _Tp, _Absent<_Tp, _Disc>>; > > That would avoid having to type 0, 1, ... manually.
This is subjectively horrible and, more objectively, would create longer mangled names and additional RTTI.