Path: blob/main/contrib/llvm-project/libcxx/include/__concepts/arithmetic.h
35262 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___CONCEPTS_ARITHMETIC_H9#define _LIBCPP___CONCEPTS_ARITHMETIC_H1011#include <__config>12#include <__type_traits/is_floating_point.h>13#include <__type_traits/is_integral.h>14#include <__type_traits/is_signed.h>15#include <__type_traits/is_signed_integer.h>16#include <__type_traits/is_unsigned_integer.h>1718#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19# pragma GCC system_header20#endif2122_LIBCPP_BEGIN_NAMESPACE_STD2324#if _LIBCPP_STD_VER >= 202526// [concepts.arithmetic], arithmetic concepts2728template <class _Tp>29concept integral = is_integral_v<_Tp>;3031template <class _Tp>32concept signed_integral = integral<_Tp> && is_signed_v<_Tp>;3334template <class _Tp>35concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;3637template <class _Tp>38concept floating_point = is_floating_point_v<_Tp>;3940// Concept helpers for the internal type traits for the fundamental types.4142template <class _Tp>43concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;4445template <class _Tp>46concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;4748template <class _Tp>49concept __libcpp_integer = __libcpp_unsigned_integer<_Tp> || __libcpp_signed_integer<_Tp>;5051#endif // _LIBCPP_STD_VER >= 205253_LIBCPP_END_NAMESPACE_STD5455#endif // _LIBCPP___CONCEPTS_ARITHMETIC_H565758