GeezerVison is showing github.com — Fix gcc case · PerretB/xtensor-python@29ab8f0
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: include/xtensor-python/pyarray.hpp +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -390,6 +390,20 @@ namespace xt |
390 | 390 | static self_type ensure(pybind11::handle h); |
391 | 391 | static bool check_(pybind11::handle h); |
392 | 392 |
|
| 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 | + |
393 | 407 | private: |
394 | 408 |
|
395 | 409 | inner_shape_type m_shape; |
|
Collapse file
Copy file name to clipboardExpand all lines: include/xtensor-python/pycontainer.hpp -12Lines changed: 0 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -140,18 +140,6 @@ namespace xt |
140 | 140 | using pybind11::object::operator^; |
141 | 141 | using pybind11::object::operator<<; |
142 | 142 | 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>>=; |
155 | 143 | #endif |
156 | 144 | }; |
157 | 145 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: include/xtensor-python/pytensor.hpp +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -194,6 +194,20 @@ namespace xt |
194 | 194 | static self_type ensure(pybind11::handle h); |
195 | 195 | static bool check_(pybind11::handle h); |
196 | 196 |
|
| 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 | + |
197 | 211 | private: |
198 | 212 |
|
199 | 213 | inner_shape_type m_shape; |
|