mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
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
This commit is contained in:
parent
f47f1edfe8
commit
42b54507ea
@ -63,6 +63,8 @@ Checks: |
|
|||||||
-bugprone-unused-raii,
|
-bugprone-unused-raii,
|
||||||
|
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
|
- key: modernize-use-equals-default.IgnoreMacros
|
||||||
|
value: false
|
||||||
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
- key: performance-for-range-copy.WarnOnAllAutoCopies
|
||||||
value: true
|
value: true
|
||||||
- key: performance-inefficient-string-concatenation.StrictMode
|
- key: performance-inefficient-string-concatenation.StrictMode
|
||||||
|
@ -537,7 +537,7 @@ PYBIND11_NAMESPACE_END(detail)
|
|||||||
|
|
||||||
class dtype : public object {
|
class dtype : public object {
|
||||||
public:
|
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) {
|
explicit dtype(const buffer_info &info) {
|
||||||
dtype descr(_dtype_from_pep3118()(pybind11::str(info.format)));
|
dtype descr(_dtype_from_pep3118()(pybind11::str(info.format)));
|
||||||
|
@ -1283,7 +1283,7 @@ public:
|
|||||||
|
|
||||||
#define PYBIND11_OBJECT_CVT_DEFAULT(Name, Parent, CheckFun, ConvertFun) \
|
#define PYBIND11_OBJECT_CVT_DEFAULT(Name, Parent, CheckFun, ConvertFun) \
|
||||||
PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun) \
|
PYBIND11_OBJECT_CVT(Name, Parent, CheckFun, ConvertFun) \
|
||||||
Name() : Parent() {}
|
Name() = default;
|
||||||
|
|
||||||
#define PYBIND11_OBJECT_CHECK_FAILED(Name, o_ptr) \
|
#define PYBIND11_OBJECT_CHECK_FAILED(Name, o_ptr) \
|
||||||
::pybind11::type_error("Object of type '" \
|
::pybind11::type_error("Object of type '" \
|
||||||
@ -1306,7 +1306,7 @@ public:
|
|||||||
|
|
||||||
#define PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun) \
|
#define PYBIND11_OBJECT_DEFAULT(Name, Parent, CheckFun) \
|
||||||
PYBIND11_OBJECT(Name, Parent, CheckFun) \
|
PYBIND11_OBJECT(Name, Parent, CheckFun) \
|
||||||
Name() : Parent() {}
|
Name() = default;
|
||||||
|
|
||||||
/// \addtogroup pytypes
|
/// \addtogroup pytypes
|
||||||
/// @{
|
/// @{
|
||||||
|
Loading…
Reference in New Issue
Block a user