mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
style: clang-tidy: modernize-use-emplace
This commit is contained in:
parent
ce88e940ce
commit
4d78640830
@ -8,6 +8,7 @@ readability-container-size-empty,
|
||||
modernize-use-using,
|
||||
modernize-use-equals-default,
|
||||
modernize-use-auto,
|
||||
modernize-use-emplace,
|
||||
'
|
||||
|
||||
HeaderFilterRegex: 'pybind11/.*h'
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user