Commit 42b54507 by Aaron Gokaslan Committed by GitHub

chore: use explicit defaulting in pyobject macros (#4017)

* Use equals default in pyobject macros

* Remove extra semicolon

* Update clang-tidy equals-default rule to not ignore macros

* Fix formatting

* One last formatting change
parent f47f1edf
......@@ -63,6 +63,8 @@ Checks: |
-bugprone-unused-raii,
CheckOptions:
- key: modernize-use-equals-default.IgnoreMacros
value: false
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: true
- key: performance-inefficient-string-concatenation.StrictMode
......
......@@ -537,7 +537,7 @@ PYBIND11_NAMESPACE_END(detail)
class dtype : public object {
public:
PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_);
PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_)
explicit dtype(const buffer_info &info) {
dtype descr(_dtype_from_pep3118()(pybind11::str(info.format)));
......
......@@ -1283,7 +1283,7 @@ public:
#define PYBIND11_OBJECT_CVT_DEFAULT(Name, Parent, CheckFun, ConvertFun) \
PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun) \
Name() : Parent() {}
Name() = default;
#define PYBIND11_OBJECT_CHECK_FAILED(Name, o_ptr) \
::pybind11::type_error("Object of type '" \
......@@ -1306,7 +1306,7 @@ public:
#define PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun) \
PYBIND11_OBJECT(Name, Parent, CheckFun) \
Name() : Parent() {}
Name() = default;
/// \addtogroup pytypes
/// @{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment