Skip to content

Commit

Permalink
Modernize placement-new custom constructors
Browse files Browse the repository at this point in the history
There was one: for PolicyFile
  • Loading branch information
r-owen committed Jul 18, 2018
1 parent 5bb1500 commit 3ed06ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/lsst/pex/policy/policyFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ PYBIND11_MODULE(policyFile, mod) {
py::class_<PolicyFile, std::shared_ptr<PolicyFile>, PolicySource> cls(mod, "PolicyFile");

// SupportedFormats is not exposed to Python so don't export the default argument
cls.def("__init__",
[](PolicyFile& self, std::string const& filepath) { new (&self) PolicyFile(filepath); });
cls.def(py::init([](std::string const& filepath) { return new PolicyFile(filepath); }));

cls.def("getPath", &PolicyFile::getPath);
cls.def("exists", &PolicyFile::exists);
Expand Down

0 comments on commit 3ed06ea

Please sign in to comment.