Date: Wed, 06 Nov 2019 18:26:16 +0300
Oh, I'm sorry. There is used the argument dependent look-up. I was not attentive.
With best regards,
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
-------- Пересылаемое сообщение --------
От кого: Vladimir Grigoriev via Std-Discussion <std-discussion_at_[hidden]>
Кому: std-discussion <std-discussion_at_[hidden]>
Копия: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Дата: Среда, 6 ноября 2019, 18:05 +03:00
Тема: [std-discussion] A defect in the section 9.7.1.2 Namespace member definitions of the Standard Draft #N4820
In the paragraph #3 of the section "9.7.1.2 Namespace member definitions: there is the following example relative to friend function declarations.
namespace A {
class X {
friend void f(X); // A::f(X) is a friend
class Y {
friend void g(); // A::g is a friend
friend void h(int); // A::h is a friend
// ::h not considered
friend void f2<>(int); // ::f2<>(int) is a friend
};
};
// A::f, A::g and A::h are not visible here X x;
void g() { f(x); } // definition of A::g
void f(X) { /* ... */ } // definition of A::f
//...
However the definition of the friend function g is incorrect because the friend function f is not yet visible
I think the definitions should be exchanged
void f(X) { /* ... */ } // definition of A::f
void g() { f(x); } // definition of A::g
With best regards,
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
With best regards,
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
-------- Пересылаемое сообщение --------
От кого: Vladimir Grigoriev via Std-Discussion <std-discussion_at_[hidden]>
Кому: std-discussion <std-discussion_at_[hidden]>
Копия: Vladimir Grigoriev <vlad.moscow_at_[hidden]>
Дата: Среда, 6 ноября 2019, 18:05 +03:00
Тема: [std-discussion] A defect in the section 9.7.1.2 Namespace member definitions of the Standard Draft #N4820
In the paragraph #3 of the section "9.7.1.2 Namespace member definitions: there is the following example relative to friend function declarations.
namespace A {
class X {
friend void f(X); // A::f(X) is a friend
class Y {
friend void g(); // A::g is a friend
friend void h(int); // A::h is a friend
// ::h not considered
friend void f2<>(int); // ::f2<>(int) is a friend
};
};
// A::f, A::g and A::h are not visible here X x;
void g() { f(x); } // definition of A::g
void f(X) { /* ... */ } // definition of A::f
//...
However the definition of the friend function g is incorrect because the friend function f is not yet visible
I think the definitions should be exchanged
void f(X) { /* ... */ } // definition of A::f
void g() { f(x); } // definition of A::g
With best regards,
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
-- Std-Discussion mailing list Std-Discussion_at_lists.isocpp.org https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion ----------------------------------------------------------------------
Received on 2019-11-06 09:28:36