Skip to content

Commit

Permalink
move monostate back to <variant>
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
achabense committed Aug 17, 2023
1 parent 8674b3d commit b4aecea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 5 additions & 3 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ class basic_format_args;
_FMT_P2286_BEGIN
template <class _CharT>
struct _Format_handler;

struct _Monostate {};
_FMT_P2286_END

_EXPORT_STD template <class _Context>
Expand Down Expand Up @@ -818,7 +820,7 @@ private:

_Basic_format_arg_type _Active_state = _Basic_format_arg_type::_None;
union {
monostate _No_state = monostate{};
_Monostate _No_state{};
int _Int_state;
unsigned int _UInt_state;
long long _Long_long_state;
Expand Down Expand Up @@ -2417,7 +2419,7 @@ _EXPORT_STD using wformat_context = basic_format_context<_Fmt_wit, wchar_t>;

_FMT_P2286_BEGIN
template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, monostate) {
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, _Monostate) {
_STL_INTERNAL_CHECK(false);
return _Out;
}
Expand Down Expand Up @@ -2686,7 +2688,7 @@ _NODISCARD _OutputIt _Write_separated_integer(const char* _First, const char* co
}

template <class _CharT, class _OutputIt>
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, monostate, const _Basic_format_specs<_CharT>&, _Lazy_locale) {
_NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, _Monostate, const _Basic_format_specs<_CharT>&, _Lazy_locale) {
_STL_INTERNAL_CHECK(false);
return _Out;
}
Expand Down
2 changes: 2 additions & 0 deletions stl/inc/variant
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,8 @@ constexpr _Ret visit(_Callable&& _Obj, _Variants&&... _Args) {
}
#endif // _HAS_CXX20

_EXPORT_STD struct monostate {};

_EXPORT_STD _NODISCARD constexpr bool operator==(monostate, monostate) noexcept {
return true;
}
Expand Down
4 changes: 0 additions & 4 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -7170,10 +7170,6 @@ _NODISCARD constexpr bool _Is_finite(const _Ty _Xx) noexcept { // constexpr isfi
return _Float_abs_bits(_Xx) < _Traits::_Shifted_exponent_mask;
}

#if _HAS_CXX17
_EXPORT_STD struct monostate {};
#endif // _HAS_CXX17

#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
template <_Integer_like _Int>
_NODISCARD constexpr bool _Add_overflow(const _Int _Left, const _Int _Right, _Int& _Out) {
Expand Down

0 comments on commit b4aecea

Please sign in to comment.