2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___CHARCONV_CHARS_FORMAT_H
11 #define _LIBCPP___CHARCONV_CHARS_FORMAT_H
14 #include <__utility/to_underlying.h>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 #pragma GCC system_header
20 _LIBCPP_BEGIN_NAMESPACE_STD
22 #ifndef _LIBCPP_CXX03_LANG
24 enum class _LIBCPP_ENUM_VIS chars_format
29 general
= fixed
| scientific
32 inline _LIBCPP_INLINE_VISIBILITY
constexpr chars_format
33 operator~(chars_format __x
) {
34 return chars_format(~_VSTD::__to_underlying(__x
));
37 inline _LIBCPP_INLINE_VISIBILITY
constexpr chars_format
38 operator&(chars_format __x
, chars_format __y
) {
39 return chars_format(_VSTD::__to_underlying(__x
) &
40 _VSTD::__to_underlying(__y
));
43 inline _LIBCPP_INLINE_VISIBILITY
constexpr chars_format
44 operator|(chars_format __x
, chars_format __y
) {
45 return chars_format(_VSTD::__to_underlying(__x
) |
46 _VSTD::__to_underlying(__y
));
49 inline _LIBCPP_INLINE_VISIBILITY
constexpr chars_format
50 operator^(chars_format __x
, chars_format __y
) {
51 return chars_format(_VSTD::__to_underlying(__x
) ^
52 _VSTD::__to_underlying(__y
));
55 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format
&
56 operator&=(chars_format
& __x
, chars_format __y
) {
61 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format
&
62 operator|=(chars_format
& __x
, chars_format __y
) {
67 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format
&
68 operator^=(chars_format
& __x
, chars_format __y
) {
73 #endif // _LIBCPP_CXX03_LANG
75 _LIBCPP_END_NAMESPACE_STD
77 #endif // _LIBCPP___CHARCONV_CHARS_FORMAT_H