Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
19836707
".env.example" did not exist on "179b963525bb16d8f4a4a91a384d4e878f869103"
Commit
19836707
authored
Feb 14, 2021
by
Ralf W. Grosse-Kunstleve
Browse files
Removing py::classu, because it does not seem useful enough.
parent
c21bf78e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
13 deletions
+1
-13
include/pybind11/smart_holder.h
include/pybind11/smart_holder.h
+0
-8
tests/test_class_sh_unique_ptr_member.cpp
tests/test_class_sh_unique_ptr_member.cpp
+1
-5
No files found.
include/pybind11/smart_holder.h
View file @
19836707
...
...
@@ -18,12 +18,4 @@ 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
)
tests/test_class_sh_unique_ptr_member.cpp
View file @
19836707
...
...
@@ -41,9 +41,6 @@ private:
}
// namespace pybind11_tests
PYBIND11_SMART_HOLDER_TYPE_CASTERS
(
pybind11_tests
::
class_sh_unique_ptr_member
::
pointee
)
PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS
(
pybind11_tests
::
class_sh_unique_ptr_member
::
ptr_owner
,
std
::
unique_ptr
<
pybind11_tests
::
class_sh_unique_ptr_member
::
ptr_owner
>
)
namespace
pybind11_tests
{
namespace
class_sh_unique_ptr_member
{
...
...
@@ -53,8 +50,7 @@ TEST_SUBMODULE(class_sh_unique_ptr_member, m) {
m
.
def
(
"make_unique_pointee"
,
make_unique_pointee
);
// Could also be class_, but can conveniently be used for testing classu.
py
::
classu
<
ptr_owner
>
(
m
,
"ptr_owner"
)
py
::
class_
<
ptr_owner
>
(
m
,
"ptr_owner"
)
.
def
(
py
::
init
<
std
::
unique_ptr
<
pointee
>>
(),
py
::
arg
(
"ptr"
))
.
def
(
"is_owner"
,
&
ptr_owner
::
is_owner
)
.
def
(
"give_up_ownership_via_unique_ptr"
,
&
ptr_owner
::
give_up_ownership_via_unique_ptr
)
...
...
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