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
4fd458b6
Commit
4fd458b6
authored
Jan 28, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interleaving smart_holder_type_casters.h into cast.h.
parent
1c822758
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
include/pybind11/cast.h
+0
-0
include/pybind11/detail/smart_holder_type_casters.h
+0
-0
include/pybind11/pybind11.h
+22
-0
include/pybind11/smart_holder.h
+0
-23
No files found.
include/pybind11/cast.h
View file @
4fd458b6
This diff is collapsed.
Click to expand it.
include/pybind11/detail/smart_holder_type_casters.h
deleted
100644 → 0
View file @
1c822758
This diff is collapsed.
Click to expand it.
include/pybind11/pybind11.h
View file @
4fd458b6
...
...
@@ -2475,6 +2475,28 @@ inline function get_overload(const T *this_ptr, const char *name) {
#define PYBIND11_OVERLOAD_PURE(ret_type, cname, fn, ...) \
PYBIND11_OVERRIDE_PURE(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), fn, __VA_ARGS__);
//SMART_HOLDER_H///////////////////////////////////////////////////////////////////////////////////
// Supports easier switching between py::class_<U> and py::class_<U, py::smart_holder>:
// users can simply replace the `_` in `class_` with `h` or vice versa.
// Note though that the PYBIND11_SMART_HOLDER_TYPE_CASTERS(U) macro also needs to be
// added (for `classh`) or commented out (for `class_`).
template
<
typename
type_
,
typename
...
options
>
class
classh
:
public
class_
<
type_
,
smart_holder
,
options
...
>
{
public
:
using
class_
<
type_
,
smart_holder
,
options
...
>::
class_
;
};
// Similar in idea to `py::classh`, but for `std::unique_ptr<U>` holder, to support
// an easier transition to `py::smart_holder` as default holder.
template
<
typename
type_
,
typename
...
options
>
class
classu
:
public
class_
<
type_
,
std
::
unique_ptr
<
type_
>
,
options
...
>
{
public
:
using
class_
<
type_
,
std
::
unique_ptr
<
type_
>
,
options
...
>::
class_
;
};
//SMART_HOLDER_H///////////////////////////////////////////////////////////////////////////////////
PYBIND11_NAMESPACE_END
(
PYBIND11_NAMESPACE
)
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
...
...
include/pybind11/smart_holder.h
View file @
4fd458b6
...
...
@@ -4,27 +4,4 @@
#pragma once
#include "detail/smart_holder_type_casters.h"
#include "pybind11.h"
PYBIND11_NAMESPACE_BEGIN
(
PYBIND11_NAMESPACE
)
// Supports easier switching between py::class_<U> and py::class_<U, py::smart_holder>:
// users can simply replace the `_` in `class_` with `h` or vice versa.
// Note though that the PYBIND11_SMART_HOLDER_TYPE_CASTERS(U) macro also needs to be
// added (for `classh`) or commented out (for `class_`).
template
<
typename
type_
,
typename
...
options
>
class
classh
:
public
class_
<
type_
,
smart_holder
,
options
...
>
{
public
:
using
class_
<
type_
,
smart_holder
,
options
...
>::
class_
;
};
// Similar in idea to `py::classh`, but for `std::unique_ptr<U>` holder, to support
// an easier transition to `py::smart_holder` as default holder.
template
<
typename
type_
,
typename
...
options
>
class
classu
:
public
class_
<
type_
,
std
::
unique_ptr
<
type_
>
,
options
...
>
{
public
:
using
class_
<
type_
,
std
::
unique_ptr
<
type_
>
,
options
...
>::
class_
;
};
PYBIND11_NAMESPACE_END
(
PYBIND11_NAMESPACE
)
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