mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-18 17:05:53 +00:00
Introduce detail::always_false<>
to make the new static_assert()
more readable.
This commit is contained in:
parent
4be50fe1a9
commit
8f87e21291
@ -1372,7 +1372,7 @@ template <typename D>
|
||||
template <typename T>
|
||||
str_attr_accessor object_api<D>::attr_with_type_hint(const char *key) const {
|
||||
#if !defined(__cpp_inline_variables)
|
||||
static_assert(!std::is_same<T, T>::value,
|
||||
static_assert(always_false<T>::value,
|
||||
"C++17 feature __cpp_inline_variables not available: "
|
||||
"https://en.cppreference.com/w/cpp/language/static#Static_data_members");
|
||||
#endif
|
||||
|
@ -627,6 +627,9 @@ struct instance {
|
||||
static_assert(std::is_standard_layout<instance>::value,
|
||||
"Internal error: `pybind11::detail::instance` is not standard layout!");
|
||||
|
||||
template <typename>
|
||||
struct always_false : std::false_type {};
|
||||
|
||||
/// from __cpp_future__ import (convenient aliases from C++14/17)
|
||||
#if defined(PYBIND11_CPP14)
|
||||
using std::conditional_t;
|
||||
|
Loading…
Reference in New Issue
Block a user