Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
4d786408
Commit
4d786408
authored
Sep 10, 2020
by
Henry Schreiner
Committed by
Henry Schreiner
Sep 15, 2020
Browse files
style: clang-tidy: modernize-use-emplace
parent
ce88e940
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
.clang-tidy
.clang-tidy
+1
-0
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+1
-1
tests/pybind11_tests.cpp
tests/pybind11_tests.cpp
+2
-2
No files found.
.clang-tidy
View file @
4d786408
...
...
@@ -8,6 +8,7 @@ readability-container-size-empty,
modernize-use-using,
modernize-use-equals-default,
modernize-use-auto,
modernize-use-emplace,
'
HeaderFilterRegex: 'pybind11/.*h'
include/pybind11/pybind11.h
View file @
4d786408
...
...
@@ -543,7 +543,7 @@ protected:
self_value_and_holder
.
type
->
dealloc
(
self_value_and_holder
);
call
.
init_self
=
PyTuple_GET_ITEM
(
args_in
,
0
);
call
.
args
.
push
_back
(
reinterpret_cast
<
PyObject
*>
(
&
self_value_and_holder
));
call
.
args
.
emplace
_back
(
reinterpret_cast
<
PyObject
*>
(
&
self_value_and_holder
));
call
.
args_convert
.
push_back
(
false
);
++
args_copied
;
}
...
...
tests/pybind11_tests.cpp
View file @
4d786408
...
...
@@ -32,11 +32,11 @@ std::list<std::function<void(py::module &)>> &initializers() {
}
test_initializer
::
test_initializer
(
Initializer
init
)
{
initializers
().
push
_back
(
init
);
initializers
().
emplace
_back
(
init
);
}
test_initializer
::
test_initializer
(
const
char
*
submodule_name
,
Initializer
init
)
{
initializers
().
push
_back
([
=
](
py
::
module
&
parent
)
{
initializers
().
emplace
_back
([
=
](
py
::
module
&
parent
)
{
auto
m
=
parent
.
def_submodule
(
submodule_name
);
init
(
m
);
});
...
...
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