1 // Copyright 2022 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.
5 #ifndef BASE_CXX20_IS_CONSTANT_EVALUATED_H_
6 #define BASE_CXX20_IS_CONSTANT_EVALUATED_H_
10 // Implementation of C++20's std::is_constant_evaluated.
13 // - https://en.cppreference.com/w/cpp/types/is_constant_evaluated
14 // - https://wg21.link/meta.const.eval
15 constexpr bool is_constant_evaluated() noexcept {
16 return __builtin_is_constant_evaluated();
21 #endif // BASE_CXX20_IS_CONSTANT_EVALUATED_H_