Topic: Standalone member function declarations
Author: rado42 <rado42@my-deja.com>
Date: 2000/11/07 Raw View
Here is a question that has been bothering me for some time.
-----
class Class
{
void Member();
};
....
void Class::Member(); // <<<<
-----
1. Is the second declaration (or whatever it is called) allowed by the
standard?
2. If so, what is the meaning and purpose of such a declaration? I
found out that my compiler (MSVC) only accepts it if Class is visible
AND Member() is declared there. Which makes is redundant in ALL cases.
3. How about making standalone function member declarations legal? This
would increase encapsulation possibilities. Why do things differ for
member non-virtual and non-member functions as far as this is
concerned?
I am pretty sure that it is technically possible to declare and compile
properly even virtual functions may be declared in this way.
Any ideas?
Radoslav Getov
Sent via Deja.com http://www.deja.com/
Before you buy.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
[ Note that the FAQ URL has changed! Please update your bookmarks. ]