https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101527
--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> --- (In reply to Jonathan Wakely from comment #2) > I find it surprising, but the CWG consensus seems to be that a friend > defined inline in the class body is "a member declaration of the befriended > class". Hey Jonathan, I just found out that std::counted_iterator also has the same friend access issue. #include <iterator> int main() { std::counted_iterator<int*> it1; std::counted_iterator<const int*> it2; return it1 == it2; } https://godbolt.org/z/jGT5jhbWz