RosettaCommons / binder

Binder, tool for automatic generation of Python bindings
MIT License
321 stars 66 forks source link

Update context.cpp to comply with pybind11 2.0+ docs #297

Closed andriish closed 7 months ago

andriish commented 7 months ago

Update context.cpp to comply with pybind11 2.0+ docs, i.e. PYBIND11_DECLARE_HOLDER_TYPE from version 2.0 requires at least 3 arguments otherwise the compillers will issue warnings. See https://pybind11.readthedocs.io/en/stable/advanced/smart_ptrs.html

The first argument of PYBIND11_DECLARE_HOLDER_TYPE() should be a placeholder name that is used as a template parameter of the second argument. Thus, feel free to use any identifier, but use it consistently on both sides; also, don’t use the name of a type that already exists in your codebase.

The macro also accepts a third optional boolean parameter that is set to false by default. 
andriish commented 7 months ago

Also contains https://github.com/RosettaCommons/binder/pull/296