1
1
#pragma once
2
2
3
- #include < pybind11/eval.h>
4
3
#include < pybind11/pybind11.h>
4
+ #include < pybind11/eval.h>
5
5
6
6
#if defined(_MSC_VER) && _MSC_VER < 1910
7
7
// We get some really long type names here which causes MSVC 2015 to emit warnings
@@ -26,13 +26,13 @@ class test_initializer {
26
26
void test_submodule_##name(py::module_ &(variable))
27
27
28
28
// / Dummy type which is not exported anywhere -- something to trigger a conversion error
29
- struct UnregisteredType {};
29
+ struct UnregisteredType { };
30
30
31
31
// / A user-defined type which is exported and can be used by any test
32
32
class UserType {
33
33
public:
34
34
UserType () = default ;
35
- UserType (int i) : i(i) {}
35
+ UserType (int i) : i(i) { }
36
36
37
37
int value () const { return i; }
38
38
void set (int set) { i = set; }
@@ -46,7 +46,7 @@ class IncType : public UserType {
46
46
public:
47
47
using UserType::UserType;
48
48
IncType () = default ;
49
- IncType (const IncType &other) : IncType(other.value() + 1 ) {}
49
+ IncType (const IncType &other) : IncType(other.value() + 1 ) { }
50
50
IncType (IncType &&) = delete ;
51
51
IncType &operator =(const IncType &) = delete ;
52
52
IncType &operator =(IncType &&) = delete ;
@@ -58,21 +58,16 @@ union IntFloat {
58
58
float f;
59
59
};
60
60
61
- // / Custom cast-only type that casts to a string "rvalue" or "lvalue" depending on the cast
62
- // / context. Used to test recursive casters (e.g. std::tuple, stl containers).
61
+ // / Custom cast-only type that casts to a string "rvalue" or "lvalue" depending on the cast context.
62
+ // / Used to test recursive casters (e.g. std::tuple, stl containers).
63
63
struct RValueCaster {};
64
64
PYBIND11_NAMESPACE_BEGIN (pybind11)
65
65
PYBIND11_NAMESPACE_BEGIN(detail)
66
- template <>
67
- class type_caster<RValueCaster> {
66
+ template<> class type_caster<RValueCaster> {
68
67
public:
69
68
PYBIND11_TYPE_CASTER (RValueCaster, _ (" RValueCaster" ));
70
- static handle cast (RValueCaster &&, return_value_policy, handle) {
71
- return py::str (" rvalue" ).release ();
72
- }
73
- static handle cast (const RValueCaster &, return_value_policy, handle) {
74
- return py::str (" lvalue" ).release ();
75
- }
69
+ static handle cast (RValueCaster &&, return_value_policy, handle) { return py::str (" rvalue" ).release (); }
70
+ static handle cast (const RValueCaster &, return_value_policy, handle) { return py::str (" lvalue" ).release (); }
76
71
};
77
72
PYBIND11_NAMESPACE_END (detail)
78
73
PYBIND11_NAMESPACE_END(pybind11)
@@ -86,6 +81,5 @@ void ignoreOldStyleInitWarnings(F &&body) {
86
81
with warnings.catch_warnings():
87
82
warnings.filterwarnings("ignore", message=message, category=FutureWarning)
88
83
body()
89
- )" ,
90
- py::dict (py::arg (" body" ) = py::cpp_function (body)));
84
+ )" , py::dict (py::arg (" body" ) = py::cpp_function (body)));
91
85
}
0 commit comments