Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1151,13 +1151,19 @@ template <size_t _Len, class... _Types>
using aligned_union_t = typename aligned_union<_Len, _Types...>::type;

// STRUCT TEMPLATE underlying_type
template <class _Ty>
struct underlying_type { // determine underlying type for enum
template <class _Ty, bool = is_enum_v<_Ty>>
struct _Underlying_type {
using type = __underlying_type(_Ty);
};

template <class _Ty>
using underlying_type_t = typename underlying_type<_Ty>::type;
struct _Underlying_type<_Ty, false> {};

template <class _Ty>
struct underlying_type : _Underlying_type<_Ty> {}; // determine underlying type for enum

template <class _Ty>
using underlying_type_t = typename _Underlying_type<_Ty>::type;

// STRUCT TEMPLATE rank
template <class _Ty>
Expand Down
1 change: 1 addition & 0 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
// P0063R3 C11 Standard Library
// P0074R0 owner_less<>
// P0092R1 <chrono> floor(), ceil(), round(), abs()
// P0340R3 SFINAE-Friendly underlying_type
// P0414R2 shared_ptr<T[]>, shared_ptr<T[N]>
// P0418R2 atomic compare_exchange memory_order Requirements
// P0435R1 Overhauling common_type
Expand Down