Path: blob/main/contrib/llvm-project/libcxx/include/__charconv/chars_format.h
35262 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___CHARCONV_CHARS_FORMAT_H10#define _LIBCPP___CHARCONV_CHARS_FORMAT_H1112#include <__config>13#include <__utility/to_underlying.h>1415#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif1819_LIBCPP_BEGIN_NAMESPACE_STD2021#if _LIBCPP_STD_VER >= 172223enum class chars_format { scientific = 0x1, fixed = 0x2, hex = 0x4, general = fixed | scientific };2425inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator~(chars_format __x) {26return chars_format(~std::__to_underlying(__x));27}2829inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator&(chars_format __x, chars_format __y) {30return chars_format(std::__to_underlying(__x) & std::__to_underlying(__y));31}3233inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator|(chars_format __x, chars_format __y) {34return chars_format(std::__to_underlying(__x) | std::__to_underlying(__y));35}3637inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format operator^(chars_format __x, chars_format __y) {38return chars_format(std::__to_underlying(__x) ^ std::__to_underlying(__y));39}4041inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator&=(chars_format& __x, chars_format __y) {42__x = __x & __y;43return __x;44}4546inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator|=(chars_format& __x, chars_format __y) {47__x = __x | __y;48return __x;49}5051inline _LIBCPP_HIDE_FROM_ABI constexpr chars_format& operator^=(chars_format& __x, chars_format __y) {52__x = __x ^ __y;53return __x;54}5556#endif // _LIBCPP_STD_VER >= 175758_LIBCPP_END_NAMESPACE_STD5960#endif // _LIBCPP___CHARCONV_CHARS_FORMAT_H616263