Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
0de6e9c8
Commit
0de6e9c8
authored
Feb 11, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding messages to terse `static_assert`s, for pre-C++17 compatibility.
parent
6930847c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
include/pybind11/pybind11.h
+19
-5
No files found.
include/pybind11/pybind11.h
View file @
0de6e9c8
...
@@ -1290,13 +1290,27 @@ public:
...
@@ -1290,13 +1290,27 @@ public:
static
constexpr
bool
type_caster_type_is_smart_holder_type_caster
=
detail
::
is_smart_holder_type_caster
<
type
>::
value
;
static
constexpr
bool
type_caster_type_is_smart_holder_type_caster
=
detail
::
is_smart_holder_type_caster
<
type
>::
value
;
static
constexpr
bool
type_caster_type_is_type_caster_base_subtype
=
std
::
is_base_of
<
detail
::
type_caster_base
<
type
>
,
detail
::
type_caster
<
type
>>::
value
;
static
constexpr
bool
type_caster_type_is_type_caster_base_subtype
=
std
::
is_base_of
<
detail
::
type_caster_base
<
type
>
,
detail
::
type_caster
<
type
>>::
value
;
// Necessary conditions, but not strict.
// Necessary conditions, but not strict.
static_assert
(
!
(
detail
::
is_instantiation
<
std
::
unique_ptr
,
holder_type
>::
value
&&
type_caster_type_is_smart_holder_type_caster
));
static_assert
(
!
(
detail
::
is_instantiation
<
std
::
unique_ptr
,
holder_type
>::
value
&&
static_assert
(
!
(
detail
::
is_instantiation
<
std
::
shared_ptr
,
holder_type
>::
value
&&
type_caster_type_is_smart_holder_type_caster
));
type_caster_type_is_smart_holder_type_caster
),
static_assert
(
!
(
holder_is_smart_holder
&&
type_caster_type_is_type_caster_base_subtype
));
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS(T, std::unique_ptr<T>)?"
);
static_assert
(
!
(
detail
::
is_instantiation
<
std
::
shared_ptr
,
holder_type
>::
value
&&
type_caster_type_is_smart_holder_type_caster
),
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS(T, std::shared_ptr<T>)?"
);
static_assert
(
!
(
holder_is_smart_holder
&&
type_caster_type_is_type_caster_base_subtype
),
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_HOLDER_TYPE_CASTERS(T)?"
);
#ifdef PYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX
#ifdef PYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX
// Strict conditions cannot be enforced universally at the moment (PR #2836).
// Strict conditions cannot be enforced universally at the moment (PR #2836).
static_assert
(
holder_is_smart_holder
==
type_caster_type_is_smart_holder_type_caster
);
static_assert
(
holder_is_smart_holder
==
type_caster_type_is_smart_holder_type_caster
,
static_assert
(
!
holder_is_smart_holder
==
type_caster_type_is_type_caster_base_subtype
);
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_HOLDER_TYPE_CASTERS(T)"
" or collision with custom py::detail::type_caster<T>?"
);
static_assert
(
!
holder_is_smart_holder
==
type_caster_type_is_type_caster_base_subtype
,
"py::class_ holder vs type_caster mismatch:"
" missing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS(T, ...)"
" or collision with custom py::detail::type_caster<T>?"
);
#endif
#endif
type_record
record
;
type_record
record
;
record
.
scope
=
scope
;
record
.
scope
=
scope
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment