www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
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



c++ - Bug? Member Template Support

↑ ↓ ← Anand Krishnamoorthi <anand.shankar.k gmail.com> writes:
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.
Apr 27 2007
↑ ↓ Walter Bright <newshound1 digitalmars.com> writes:
Anand Krishnamoorthi wrote:
 begin 644 mem_thunk.cpp
 M<W1R=6-T(%, >PT*#0IT96UP;&%T93P ='EP96YA;64 1&5R=BP =F]I9"`H
 M1&5R=CHZ*E!&*2 I(#X-"G9O:60 =&AU;FLH*3L-"GT[#0H-"G-T<G5C="!$
 M97)V(#H 4R![#0H)=F]I9"!F=6YC*"D >WT-"GT[#0H-"G1E;7!L871E/"!T
 M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N
 M:R I.PT*#0H-"G9O:60 =&5S=%]F=6YC*"D-"GL-" DF4SHZ=&AU;FL\($1E
 M<G8L("9$97)V.CIF=6YC(#X[#0H))G1H=6YK/"` 1&5R=BP )D1E<G8Z.F9U
 *;F, /CL-"GT-" ``
 `
 end

Can you attach this as a text file, please? Thunderbird mail won't decode it.
Apr 27 2007
→ Anand Krishnamoorthi <anand.shankar.k gmail.com> writes:
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 >;
}
Apr 28 2007
→ Bertel Brander <bertel post4.tele.dk> writes:
Walter Bright skrev:
 Anand Krishnamoorthi wrote:
 begin 644 mem_thunk.cpp
 M<W1R=6-T(%, >PT*#0IT96UP;&%T93P ='EP96YA;64 1&5R=BP =F]I9"`H
 M1&5R=CHZ*E!&*2 I(#X-"G9O:60 =&AU;FLH*3L-"GT[#0H-"G-T<G5C="!$
 M97)V(#H 4R![#0H)=F]I9"!F=6YC*"D >WT-"GT[#0H-"G1E;7!L871E/"!T
 M>7!E;F%M92!$97)V+"!V;VED("A$97)V.CHJ4$8I*"D / T*=F]I9"!T:'5N
 M:R I.PT*#0H-"G9O:60 =&5S=%]F=6YC*"D-"GL-" DF4SHZ=&AU;FL\($1E
 M<G8L("9$97)V.CIF=6YC(#X[#0H))G1H=6YK/"` 1&5R=BP )D1E<G8Z.F9U
 *;F, /CL-"GT-" ``
 `
 end

Can you attach this as a text file, please? Thunderbird mail won't decode it.

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 - Bertel
Apr 28 2007