Thread View: comp.std.c++
1 messages
1 total messages
Started by Michael Rice
Thu, 28 Sep 1995 21:44
Use of nested class inlines
Author: Michael Rice
Date: Thu, 28 Sep 1995 21:44
Date: Thu, 28 Sep 1995 21:44
32 lines
1224 bytes
1224 bytes
A short example:
extern "C" int printf(const char*, ...);
struct Y {
struct XX {
Y* ht_;
void z() { (*ht_).f(); }
XX(Y* h) : ht_(h) {}
};
void f() { printf("Yes\n"); }
};
main()
{
Y yv;
Y::XX xv(&yv);
xv.z();
return 0;
}
According to the draft standard, should this program compile?
Some current compilers accept it, others don't. The question is
where should the compiler check the inline function z()? If it is
at the end of class XX, you'll get an error. At the end of Y or at
the call point, no error.
--
-Mike
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads