 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Daniel Frey Guest
|
Posted: Mon Jul 14, 2003 9:58 pm Post subject: About DR 372 |
|
|
I just read DR 372 and I think that the problem presented is not really
discussed/solved properly. Consider this example:
class A {
protected:
typedef int N;
};
template< typename T >
class B
{};
template< typename U >
class C : public U, public B< typename U::N >
{};
C< A > x;
The question is: If C is derived from A as above, is it allowed to
access A::N before the classes opening '{'?
The main problem is that you need to access U's protected parts in C's
base-clause. This pattern is common when using policies, Andrei's Loki
library was bitten by it as he tried to make some parts of the policies
'protected' but some compilers rejected the code. They were right to
reject it, I think it's 11.4/2 that applies here and prevents the code
above to be legal, although it addresses a different and reasonable
example. To me, it seems wrong to reject the code as it is perfectly
reasonable to write such stuff. The questions are:
- Do you agree it's reasonable?
- Is it a DR or is it a request for an extension?
- Is DR 372 the right place to address it or shall it be a new DR?
Regards, Daniel
--
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: [email]daniel.frey (AT) aixigo (DOT) de[/email], web: http://www.aixigo.de
---
[ 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.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Powered by phpBB © 2001, 2006 phpBB Group
|