mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
fix: allow -Wpedantic in C++20 mode (#5322)
* fix: allow -Wpedantic again Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: ignore pedantic warning for PYBIND11_DECLARE_HOLDER_TYPE Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: try just turning off pedantic for one file Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: only run pedantic in C++20 mode Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update tests/local_bindings.h --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -162,7 +162,7 @@ the declaration
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
PYBIND11_MAKE_OPAQUE(std::vector<int>);
|
||||
PYBIND11_MAKE_OPAQUE(std::vector<int>)
|
||||
|
||||
before any binding code (e.g. invocations to ``class_::def()``, etc.). This
|
||||
macro must be specified at the top level (and outside of any namespaces), since
|
||||
@@ -207,8 +207,8 @@ The following example showcases usage of :file:`pybind11/stl_bind.h`:
|
||||
// Don't forget this
|
||||
#include <pybind11/stl_bind.h>
|
||||
|
||||
PYBIND11_MAKE_OPAQUE(std::vector<int>);
|
||||
PYBIND11_MAKE_OPAQUE(std::map<std::string, double>);
|
||||
PYBIND11_MAKE_OPAQUE(std::vector<int>)
|
||||
PYBIND11_MAKE_OPAQUE(std::map<std::string, double>)
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ top namespace level before any binding code:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>)
|
||||
|
||||
The first argument of :func:`PYBIND11_DECLARE_HOLDER_TYPE` should be a
|
||||
placeholder name that is used as a template parameter of the second argument.
|
||||
@@ -136,7 +136,7 @@ by default. Specify
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>, true);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>, true)
|
||||
|
||||
if ``SmartPtr<T>`` can always be initialized from a ``T*`` pointer without the
|
||||
risk of inconsistencies (such as multiple independent ``SmartPtr`` instances
|
||||
@@ -154,7 +154,7 @@ specialized:
|
||||
.. code-block:: cpp
|
||||
|
||||
// Always needed for custom holder types
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, SmartPtr<T>)
|
||||
|
||||
// Only needed if the type's `.get()` goes by another name
|
||||
namespace PYBIND11_NAMESPACE { namespace detail {
|
||||
|
||||
Reference in New Issue
Block a user