digitalmars.D.bugs - Member type selection hassles, now becoming severely problematic: can't use typeof in base class list
- Matthew Wilson (10/10) Jul 15 2004 Because of prior problems with failure to access member types (which are
- Walter (21/30) Jul 17 2004 declaring
Because of prior problems with failure to access member types (which are interpreted as properties), I've found a way to hack around it by declaring a static member of the given type, and then using typeof on that member. However, when trying to use it in base classes, as shown below, it's not acceptable to the compiler. template FilteredNotionalRange(R, F) { class FilteredNotionalRange // : public R.range_type : public typeof(R.range_type_hack) { . . .
Jul 15 2004
"Matthew Wilson" <admin.hat stlsoft.dot.org> wrote in message news:cd7jr4$2nnf$1 digitaldaemon.com...Because of prior problems with failure to access member types (which are interpreted as properties), I've found a way to hack around it bydeclaringa static member of the given type, and then using typeof on that member. However, when trying to use it in base classes, as shown below, it's not acceptable to the compiler. template FilteredNotionalRange(R, F) { class FilteredNotionalRange // : public R.range_type : public typeof(R.range_type_hack) {Your example is incomplete, so I dummied up one: ------------------------------------------- class A { typedef A atype; int a; } class B : A.atype { int b; } void main() { B b = new B(); b.a = 3; } ---------------------------------------- and it compiles successfully.
Jul 17 2004