|
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.learn - "This for <member> needs to be type <class>, not type <otherclass>"
While playing around with templates and alias parameters, I got the die of
trying this:
struct foo(alias T)
{
typeof(T) opAddAssign(typeof(T) rhs)
{
return T += rhs;
}
}
class bar
{
private:
int _baz;
public:
foo!(_baz) baz;
}
When compiling this, I get the message "Error: this for_baz needs to be type
bar not type foo!(_baz)*"
Is there a workaround to this, or even a plan to make such things possible in
the future?
-- Simen
May 02 2008
"Simen Kjaeraas" <simen.kjaras gmail.com> wrote in message news:fvfg2g$1nnp$1 digitalmars.com... May 02 2008
Jarrett Billingsley Wrote:"Simen Kjaeraas" <simen.kjaras gmail.com> wrote in message news:fvfg2g$1nnp$1 digitalmars.com... May 02 2008
|