File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,9 @@ class ReferenceSensitiveOptional {
120
120
using value_type = T;
121
121
122
122
ReferenceSensitiveOptional () = default ;
123
+ // NOLINTNEXTLINE(google-explicit-constructor)
123
124
ReferenceSensitiveOptional (const T& value) : storage{value} {}
125
+ // NOLINTNEXTLINE(google-explicit-constructor)
124
126
ReferenceSensitiveOptional (T&& value) : storage{std::move (value)} {}
125
127
ReferenceSensitiveOptional& operator =(const T& value) {
126
128
storage = {value};
@@ -162,7 +164,8 @@ class ReferenceSensitiveOptional {
162
164
namespace pybind11 { namespace detail {
163
165
template <typename T>
164
166
struct type_caster <ReferenceSensitiveOptional<T>> : optional_caster<ReferenceSensitiveOptional<T>> {};
165
- }} // namespace pybind11::detail
167
+ } // namespace pybind11::detail
168
+ } // namespace pybind11
166
169
167
170
168
171
TEST_SUBMODULE (stl, m) {
@@ -365,7 +368,7 @@ TEST_SUBMODULE(stl, m) {
365
368
return x.value_or (0 ) * 2 ;
366
369
});
367
370
m.def (" half_or_none_boost" , [](int x) -> boost_opt_int {
368
- return x ? boost_opt_int (x / 2 ) : boost_opt_int ();
371
+ return x != 0 ? boost_opt_int (x / 2 ) : boost_opt_int ();
369
372
});
370
373
m.def (" test_nullopt_boost" , [](boost_opt_int x) {
371
374
return x.value_or (42 );
You can’t perform that action at this time.
0 commit comments