Thread overview | |||||
---|---|---|---|---|---|
|
July 15, 2004 Interface member classes have no code generated | ||||
---|---|---|---|---|
| ||||
I get " Error 42: Symbol Undefined __Class_3std3dtl6common10IContainer9Container" from the following code interface IContainer { public: alias uint index_type; alias uint size_type; public: class Container : public IContainer { public: bool isEmpty(); IEnumerator enumerate() { return new Enumerator(this.toArray()); } protected: abstract Object[] toArray(); } alias Container selecting_type; static selecting_type hack; // IContainer methods public: /// Denotes whether the given container is empty bool isEmpty(); /// Returns an enumerator object representing the elements of the container IEnumerator enumerate(); } |
July 17, 2004 Re: Interface member classes have no code generated | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | Interfaces are only supposed to have member functions in them. Anything else should generate an error. "Matthew Wilson" <admin.hat@stlsoft.dot.org> wrote in message news:cd4vbd$1ih4$1@digitaldaemon.com... > I get > > " Error 42: Symbol Undefined > __Class_3std3dtl6common10IContainer9Container" > > from the following code > > > interface IContainer > { > public: > alias uint index_type; > alias uint size_type; > > public: > class Container > : public IContainer > { > public: > bool isEmpty(); > IEnumerator enumerate() > { > return new Enumerator(this.toArray()); > } > > protected: > abstract Object[] toArray(); > } > > alias Container selecting_type; > > static selecting_type hack; > > // IContainer methods > public: > /// Denotes whether the given container is empty > bool isEmpty(); > /// Returns an enumerator object representing the elements of the > container > IEnumerator enumerate(); > } > > > |
July 17, 2004 Re: Interface member classes have no code generated | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Wow! If that's the case: - I'd *like* you to enhance the lang to allow any kinds of member types, including classes, other interfaces, static members. Given the fact that interfaces/classes currently don't appear to have their member types accessible to the outside world, I'm using static members + typeof as a temporary hack. - I have to suggest that they *must* be allowed to have member aliases/typedefs. Otherwise, DTL and other template libs are going to be impossible/crippled/very-unobvious "Walter" <newshound@digitalmars.com> wrote in message news:cda8ht$ssu$2@digitaldaemon.com... > Interfaces are only supposed to have member functions in them. Anything else should generate an error. > > "Matthew Wilson" <admin.hat@stlsoft.dot.org> wrote in message news:cd4vbd$1ih4$1@digitaldaemon.com... > > I get > > > > " Error 42: Symbol Undefined > > __Class_3std3dtl6common10IContainer9Container" > > > > from the following code > > > > > > interface IContainer > > { > > public: > > alias uint index_type; > > alias uint size_type; > > > > public: > > class Container > > : public IContainer > > { > > public: > > bool isEmpty(); > > IEnumerator enumerate() > > { > > return new Enumerator(this.toArray()); > > } > > > > protected: > > abstract Object[] toArray(); > > } > > > > alias Container selecting_type; > > > > static selecting_type hack; > > > > // IContainer methods > > public: > > /// Denotes whether the given container is empty > > bool isEmpty(); > > /// Returns an enumerator object representing the elements of the > > container > > IEnumerator enumerate(); > > } > > > > > > > > |
Copyright © 1999-2021 by the D Language Foundation