|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - Forbid the use of method name "init"
"init" and other class properties are kind of shadow-keywords.
class MyClass{
void init(){
}
}
The class is fine and can be used.
Now someone attempts to insert this class into a container....
template Templ(T){
T t = T.init; // Compile error
}
The compiler should forbid the use of the method name "init", if the
signature does not make any sense for an "init" property. It must be a
static method, with a return value and no arguments.
May 10 2008
"Frank Benoit" <keinfarbton googlemail.com> wrote in message news:g052dt$qt4$1 digitalmars.com... May 10 2008
=D4=DA Sun, 11 May 2008 05:46:57 +0800=A3=ACJarrett Billingsley = <kb3ctd2 yahoo.com> =D0=B4=B5=C0:"Frank Benoit" <keinfarbton googlemail.com> wrote in message news:g052dt$qt4$1 digitalmars.com... May 10 2008
davidl 126.com wrote:ÔÚ Sun, 11 May 2008 05:46:57 +0800£¬Jarrett Billingsley <kb3ctd2 yahoo.com> дµÀ:"Frank Benoit" <keinfarbton googlemail.com> wrote in message news:g052dt$qt4$1 digitalmars.com... May 27 2008
|