-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration ring_iterator friend operator+=() #90
Comments
Looks like we've stumbled over FAQ: Why do I get linker errors when I use template friends?. |
However, I believe the suggested resolution causes every |
Also, already logged as #77 but never apparently acted upon. |
Yeah that's the one. The compile-time (as opposed to link-time) error message (for my incantation of ring_span) with GNU 5.2 was:
|
@TBBle Thanks for your notes. What are reasons to not declare
and
|
I'd defer that question to the paper editors, @hatcat and @Quuxplusone. Side-note, I've just confirmed this warning on g++ 6.3.0. I intend under #96 to try and get better test coverage in-place so that things like this can't easily slip past. |
Yeah, the free-function operators should be in the sg14 namespace. Almost certainly an oversight, it breaks the build on VS2017 which can't find them, and hence can't use Edit: Different issue. We're actually missing |
Binary Operators in the Stackoverflow C++ Operator mega-answer agrees with @martinmoene's approach:
|
Resovles WG21-SG14#90, but is simply the most minimal change. * Inline the bodies of the friend functions operator+= and operator-= * Add inline friend operator- for a pair of ring_iterator, to support std::difference on MSVC * Put the free functions operator+ and operator- in the sg14 namespace so they are visible to ADL
My current hack-tree is https://github.com/TBBle/SG14/tree/SG14-build-fix-hacks, which when merged with #95, gets everything building on the platforms I happen to be testing on (four Windows x64 compilers). I simply took the Make New Friends idiom in order to get it to compile. The above-described approach is better. |
- Add `#pragma once`. - Add a non-member ADL swap() for rings. - Fix up the namespace of operator+= and operator-= for ring iterators. - Fix up (it + n) and (it - n) for ring iterators. - Add (it - it) for ring iterators. - Add the implicit conversion from iterator to const_iterator. - `#if 0` the broken tests for unimplemented static_ring and dynamic_ring. Fixes WG21-SG14#77, WG21-SG14#90.
Resovles WG21-SG14#90, but is simply the most minimal change. * Inline the bodies of the friend functions operator+= and operator-= * Add inline friend operator- for a pair of ring_iterator, to support std::difference on MSVC * Put the free functions operator+ and operator- in the sg14 namespace so they are visible to ADL
- Add `#pragma once`. - Add a non-member ADL swap() for rings. - Fix up the namespace of operator+= and operator-= for ring iterators. - Fix up (it + n) and (it - n) for ring iterators. - Add (it - it) for ring iterators. - Fix a typo in (a >= b) for ring iterators, and make (a <= b) == !(b > a). - Add the implicit conversion from iterator to const_iterator. - `#if 0` the broken tests for unimplemented static_ring and dynamic_ring. Fixes WG21-SG14#77, WG21-SG14#90, WG21-SG14#93, WG21-SG14#101.
- Add `#pragma once`. - Add a non-member ADL swap() for rings. - Fix up the namespace of operator+= and operator-= for ring iterators. - Fix up (it + n) and (it - n) for ring iterators. - Add (it - it) for ring iterators. - Fix a typo in (a >= b) for ring iterators, and make (a <= b) == !(b > a). - Add the implicit conversion from iterator to const_iterator. - `#if 0` the broken tests for unimplemented static_ring and dynamic_ring. Fixes WG21-SG14#77, WG21-SG14#90, WG21-SG14#93, WG21-SG14#101.
- Add `#pragma once`. - Add a non-member ADL swap() for rings. - Fix up the namespace of operator+= and operator-= for ring iterators. - Fix up (it + n) and (it - n) for ring iterators. - Add (it - it) for ring iterators. - Fix a typo in (a >= b) for ring iterators, and make (a <= b) == !(b > a). - Add the implicit conversion from iterator to const_iterator. - `#if 0` the broken tests for unimplemented static_ring and dynamic_ring. Fixes WG21-SG14#75, WG21-SG14#77, WG21-SG14#90, WG21-SG14#93, WG21-SG14#101.
- Add `#pragma once`. - Add a non-member ADL swap() for rings. - Fix up the namespace of operator+= and operator-= for ring iterators. - Fix up (it + n) and (it - n) for ring iterators. - Add (it - it) for ring iterators. - Fix a typo in (a >= b) for ring iterators, and make (a <= b) == !(b > a). - Add the implicit conversion from iterator to const_iterator. - `#if 0` the broken tests for unimplemented static_ring and dynamic_ring. Fixes WG21-SG14#75, WG21-SG14#77, WG21-SG14#90, WG21-SG14#93, WG21-SG14#101.
Can this issue be closed as "fixed," at this point? |
Shouldn't the friend declaration of
ring_iterator
'soperator+=()
andoperator-=()
beinstead of
GNU C++ 5.2 warns (-Wnon-template-friend)
The text was updated successfully, but these errors were encountered: