c++ - Bug? Member Template Support
- Anand Krishnamoorthi (26/26) Apr 27 2007 Hi,
- Walter Bright (3/13) Apr 27 2007 Can you attach this as a text file, please? Thunderbird mail won't
- Anand Krishnamoorthi (29/29) Apr 28 2007 Hi,
- Bertel Brander (9/23) Apr 28 2007 You can get the .cpp file as plain text file at the web interface:
Hi, Here's an obscure bug. My understanding is that the code is Standard C++. I get Internal error: exp2 1229 when a member function ptr is passed as a non type template argument to a member template. However when a member function ptr is passed as a non type template argument to a global template function, things work fine. Code attached. Best Regards, Anand. begin 644 mem_thunk.cpp M1&5R=CHZ*E!&*2 I(#X- M97)V(#H M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N M<G8L("9$97)V.CIF=6YC(#X *;F, /CL-"GT-" `` ` end
Apr 27 2007
Anand Krishnamoorthi wrote:begin 644 mem_thunk.cpp M1&5R=CHZ*E!&*2 I(#X- M97)V(#H M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N M<G8L("9$97)V.CIF=6YC(#X *;F, /CL-"GT-" `` ` endCan you attach this as a text file, please? Thunderbird mail won't decode it.
Apr 27 2007
Hi, Code follows this mail. Best Regards, Anand. ------------------------------------------- struct S { template< typename Derv, void (Derv::*PF)() > void thunk(); }; struct Derv : S { void func() {} }; template< typename Derv, void (Derv::*PF)() > void thunk(); void test_func() { &S::thunk< Derv, &Derv::func >; &thunk< Derv, &Derv::func >; } begin 644 mem_thunk.txt M1&5R=CHZ*E!&*2 I(#X- M97)V(#H M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N M<G8L("9$97)V.CIF=6YC(#X *;F, /CL-"GT-" `` ` end
Apr 28 2007
Walter Bright skrev:Anand Krishnamoorthi wrote:You can get the .cpp file as plain text file at the web interface: http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++&artnum=5521 I think Digital Mars (or whoever) should fix this problem, its not the first time I have seen this problem. -- Just another homepage: http://damb.dk But it's mine - Bertelbegin 644 mem_thunk.cpp M1&5R=CHZ*E!&*2 I(#X- M97)V(#H M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N M<G8L("9$97)V.CIF=6YC(#X *;F, /CL-"GT-" `` ` endCan you attach this as a text file, please? Thunderbird mail won't decode it.
Apr 28 2007