File tree Expand file tree Collapse file tree 3 files changed +28
-12
lines changed
Expand file tree Collapse file tree 3 files changed +28
-12
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,20 @@ namespace xt
390390 static self_type ensure (pybind11::handle h);
391391 static bool check_ (pybind11::handle h);
392392
393+ #if PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3
394+ // Prevent ambiguous overload resolution for operators defined for
395+ // both xt::xcontainer_semantic and pybind11::object.
396+ using semantic_base::operator +=;
397+ using semantic_base::operator -=;
398+ using semantic_base::operator *=;
399+ using semantic_base::operator /=;
400+ using semantic_base::operator |=;
401+ using semantic_base::operator &=;
402+ using semantic_base::operator ^=;
403+ // using semantic_base::operator<<=;
404+ // using semantic_base::operator>>=;
405+ #endif
406+
393407 private:
394408
395409 inner_shape_type m_shape;
Original file line number Diff line number Diff line change @@ -140,18 +140,6 @@ namespace xt
140140 using pybind11::object::operator ^;
141141 using pybind11::object::operator <<;
142142 using pybind11::object::operator >>;
143-
144- // Prevent ambiguous overload resolution for operators defined for
145- // both xt::xcontainer_semantic and pybind11::object.
146- using pybind11::object::operator +=;
147- using pybind11::object::operator -=;
148- using pybind11::object::operator *=;
149- using pybind11::object::operator /=;
150- using pybind11::object::operator |=;
151- using pybind11::object::operator &=;
152- using pybind11::object::operator ^=;
153- using pybind11::object::operator <<=;
154- using pybind11::object::operator >>=;
155143#endif
156144 };
157145
Original file line number Diff line number Diff line change @@ -194,6 +194,20 @@ namespace xt
194194 static self_type ensure (pybind11::handle h);
195195 static bool check_ (pybind11::handle h);
196196
197+ #if PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3
198+ // Prevent ambiguous overload resolution for operators defined for
199+ // both xt::xcontainer_semantic and pybind11::object.
200+ using semantic_base::operator +=;
201+ using semantic_base::operator -=;
202+ using semantic_base::operator *=;
203+ using semantic_base::operator /=;
204+ using semantic_base::operator |=;
205+ using semantic_base::operator &=;
206+ using semantic_base::operator ^=;
207+ // using semantic_base::operator<<=;
208+ // using semantic_base::operator>>=;
209+ #endif
210+
197211 private:
198212
199213 inner_shape_type m_shape;
You can’t perform that action at this time.
0 commit comments