v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
integral_constant_like.h
Go to the documentation of this file.
1// Copyright 2024 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Slightly adapted for inclusion in V8.
6// Copyright 2025 the V8 project authors. All rights reserved.
7
8#ifndef V8_BASE_NUMERICS_INTEGRAL_CONSTANT_LIKE_H_
9#define V8_BASE_NUMERICS_INTEGRAL_CONSTANT_LIKE_H_
10
11#include <concepts>
12#include <type_traits>
13
14namespace v8::base {
15
16// Exposition-only concept from [span.syn]
17template <typename T>
19 std::is_integral_v<decltype(T::value)> &&
20 !std::is_same_v<bool, std::remove_const_t<decltype(T::value)>> &&
21 std::convertible_to<T, decltype(T::value)> &&
22 std::equality_comparable_with<T, decltype(T::value)> &&
23 std::bool_constant<T() == T::value>::value &&
24 std::bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value;
25
26} // namespace v8::base
27
28#endif // V8_BASE_NUMERICS_INTEGRAL_CONSTANT_LIKE_H_
#define T
std::unique_ptr< ValueMirror > value