Warning, /include/c++/v1/bit is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===---------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP_BIT
0011 #define _LIBCPP_BIT
0012
0013 /*
0014 bit synopsis
0015
0016 namespace std {
0017 // [bit.cast], bit_cast
0018 template<class To, class From>
0019 constexpr To bit_cast(const From& from) noexcept; // C++20
0020
0021 // [bit.byteswap], byteswap
0022 template<class T>
0023 constexpr T byteswap(T value) noexcept; // C++23
0024
0025 // [bit.pow.two], integral powers of 2
0026 template <class T>
0027 constexpr bool has_single_bit(T x) noexcept; // C++20
0028 template <class T>
0029 constexpr T bit_ceil(T x); // C++20
0030 template <class T>
0031 constexpr T bit_floor(T x) noexcept; // C++20
0032 template <class T>
0033 constexpr int bit_width(T x) noexcept; // C++20
0034
0035 // [bit.rotate], rotating
0036 template<class T>
0037 constexpr T rotl(T x, int s) noexcept; // C++20
0038 template<class T>
0039 constexpr T rotr(T x, int s) noexcept; // C++20
0040
0041 // [bit.count], counting
0042 template<class T>
0043 constexpr int countl_zero(T x) noexcept; // C++20
0044 template<class T>
0045 constexpr int countl_one(T x) noexcept; // C++20
0046 template<class T>
0047 constexpr int countr_zero(T x) noexcept; // C++20
0048 template<class T>
0049 constexpr int countr_one(T x) noexcept; // C++20
0050 template<class T>
0051 constexpr int popcount(T x) noexcept; // C++20
0052
0053 // [bit.endian], endian
0054 enum class endian {
0055 little = see below, // C++20
0056 big = see below, // C++20
0057 native = see below // C++20
0058 };
0059
0060 } // namespace std
0061
0062 */
0063
0064 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0065 # include <__cxx03/bit>
0066 #else
0067 # include <__config>
0068
0069 # if _LIBCPP_STD_VER >= 20
0070 # include <__bit/bit_cast.h>
0071 # include <__bit/bit_ceil.h>
0072 # include <__bit/bit_floor.h>
0073 # include <__bit/bit_log2.h>
0074 # include <__bit/bit_width.h>
0075 # include <__bit/countl.h>
0076 # include <__bit/countr.h>
0077 # include <__bit/endian.h>
0078 # include <__bit/has_single_bit.h>
0079 # include <__bit/popcount.h>
0080 # include <__bit/rotate.h>
0081 # endif
0082
0083 # if _LIBCPP_STD_VER >= 23
0084 # include <__bit/byteswap.h>
0085 # endif
0086
0087 # include <version>
0088
0089 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0090 # pragma GCC system_header
0091 # endif
0092
0093 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0094 # include <cstdlib>
0095 # include <iosfwd>
0096 # include <limits>
0097 # include <type_traits>
0098 # endif
0099 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0100
0101 #endif // _LIBCPP_BIT