[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / libcxx / include / __charconv / chars_format.h
blob22e70b56fb8c51f9671deebfad6426a080637229
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
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
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___CHARCONV_CHARS_FORMAT_H
11 #define _LIBCPP___CHARCONV_CHARS_FORMAT_H
13 #include <__config>
14 #include <__utility/to_underlying.h>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 #pragma GCC system_header
18 #endif
20 _LIBCPP_BEGIN_NAMESPACE_STD
22 #ifndef _LIBCPP_CXX03_LANG
24 enum class _LIBCPP_ENUM_VIS chars_format
26 scientific = 0x1,
27 fixed = 0x2,
28 hex = 0x4,
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) {
57 __x = __x & __y;
58 return __x;
61 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
62 operator|=(chars_format& __x, chars_format __y) {
63 __x = __x | __y;
64 return __x;
67 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format&
68 operator^=(chars_format& __x, chars_format __y) {
69 __x = __x ^ __y;
70 return __x;
73 #endif // _LIBCPP_CXX03_LANG
75 _LIBCPP_END_NAMESPACE_STD
77 #endif // _LIBCPP___CHARCONV_CHARS_FORMAT_H