Follow-on to PR #3148 (cang-tidy).

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-07-27 16:18:30 -07:00
parent 45ef484366
commit 119db695ca
3 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ std::string pass_mref(atyp& obj) { return "pass_mref:" + obj.mtxt; }
std::string pass_cptr(atyp const* obj) { return "pass_cptr:" + obj->mtxt; } std::string pass_cptr(atyp const* obj) { return "pass_cptr:" + obj->mtxt; }
std::string pass_mptr(atyp* obj) { return "pass_mptr:" + obj->mtxt; } std::string pass_mptr(atyp* obj) { return "pass_mptr:" + obj->mtxt; }
std::shared_ptr<atyp> rtrn_shmp() { return std::shared_ptr<atyp >(new atyp{"rtrn_shmp"}); } std::shared_ptr<atyp> rtrn_shmp() { return std::make_shared<atyp>("rtrn_shmp"); }
std::shared_ptr<atyp const> rtrn_shcp() { return std::shared_ptr<atyp const>(new atyp{"rtrn_shcp"}); } std::shared_ptr<atyp const> rtrn_shcp() { return std::shared_ptr<atyp const>(new atyp{"rtrn_shcp"}); }
std::string pass_shmp(std::shared_ptr<atyp> obj) { return "pass_shmp:" + obj->mtxt; } // NOLINT std::string pass_shmp(std::shared_ptr<atyp> obj) { return "pass_shmp:" + obj->mtxt; } // NOLINT

View File

@ -40,7 +40,7 @@ atyp_mref& rtrn_mref() { static atyp_mref obj; obj.mtxt = "Mref"; return o
atyp_cptr const* rtrn_cptr() { return new atyp_cptr{"Cptr"}; } atyp_cptr const* rtrn_cptr() { return new atyp_cptr{"Cptr"}; }
atyp_mptr* rtrn_mptr() { return new atyp_mptr{"Mptr"}; } atyp_mptr* rtrn_mptr() { return new atyp_mptr{"Mptr"}; }
std::shared_ptr<atyp_shmp> rtrn_shmp() { return std::shared_ptr<atyp_shmp >(new atyp_shmp{"Shmp"}); } std::shared_ptr<atyp_shmp> rtrn_shmp() { return std::make_shared<atyp_shmp>(atyp_shmp{"Shmp"}); }
std::shared_ptr<atyp_shcp const> rtrn_shcp() { return std::shared_ptr<atyp_shcp const>(new atyp_shcp{"Shcp"}); } std::shared_ptr<atyp_shcp const> rtrn_shcp() { return std::shared_ptr<atyp_shcp const>(new atyp_shcp{"Shcp"}); }
std::unique_ptr<atyp_uqmp> rtrn_uqmp() { return std::unique_ptr<atyp_uqmp >(new atyp_uqmp{"Uqmp"}); } std::unique_ptr<atyp_uqmp> rtrn_uqmp() { return std::unique_ptr<atyp_uqmp >(new atyp_uqmp{"Uqmp"}); }
@ -164,7 +164,7 @@ TEST_SUBMODULE(class_sh_factory_constructors, m) {
return p; return p;
})) }))
.def(py::init([](int i, int j, int k) { .def(py::init([](int i, int j, int k) {
auto p = std::shared_ptr<with_alias_alias>(new with_alias_alias); auto p = std::make_shared<with_alias_alias>();
p->val = i * 100 + j * 10 + k; p->val = i * 100 + j * 10 + k;
return p; return p;
})) }))

View File

@ -34,8 +34,8 @@ inline base *rtrn_mptr_drvd_up_cast() { return new drvd; }
inline int pass_cptr_base(base const *b) { return b->id() + 11; } inline int pass_cptr_base(base const *b) { return b->id() + 11; }
inline int pass_cptr_drvd(drvd const *d) { return d->id() + 12; } inline int pass_cptr_drvd(drvd const *d) { return d->id() + 12; }
inline std::shared_ptr<drvd> rtrn_shmp_drvd() { return std::shared_ptr<drvd>(new drvd); } inline std::shared_ptr<drvd> rtrn_shmp_drvd() { return std::make_shared<drvd>(); }
inline std::shared_ptr<base> rtrn_shmp_drvd_up_cast() { return std::shared_ptr<drvd>(new drvd); } inline std::shared_ptr<base> rtrn_shmp_drvd_up_cast() { return std::make_shared<drvd>(); }
inline int pass_shcp_base(const std::shared_ptr<base const>& b) { return b->id() + 21; } inline int pass_shcp_base(const std::shared_ptr<base const>& b) { return b->id() + 21; }
inline int pass_shcp_drvd(const std::shared_ptr<drvd const>& d) { return d->id() + 22; } inline int pass_shcp_drvd(const std::shared_ptr<drvd const>& d) { return d->id() + 22; }