Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 20th, 2007, 05:45 PM
SzH
Guest
 
Posts: n/a
Default Is this code wrong? Or is there a bug in the compiler?


The code below compiles with gcc, but not with Digital Mars C++ (dmc).
Is the code wrong or is there a bug in dmc?


template<typename Tclass arr { T x; };

template<void (*D)(const arr<double>)class ode { };

void fun(const arr<double>) { }

int main() {
ode<funodeInst;
return 0;
}

dmc gives the following error message:

ode<funodeInst;
^
sim.cpp(9) : Error: need explicit cast to convert
from: void (*C func)(const arr<double >)
to : void (*C func)(const arr<double >)
--- errorlevel 1

  #2  
Old April 20th, 2007, 05:55 PM
mlimber
Guest
 
Posts: n/a
Default Re: Is this code wrong? Or is there a bug in the compiler?

On Apr 20, 12:34 pm, SzH <szhor...@gmail.comwrote:
Quote:
The code below compiles with gcc, but not with Digital Mars C++ (dmc).
Is the code wrong or is there a bug in dmc?
>
template<typename Tclass arr { T x; };
>
template<void (*D)(const arr<double>)class ode { };
>
void fun(const arr<double>) { }
>
int main() {
ode<funodeInst;
return 0;
>
}
>
dmc gives the following error message:
>
ode<funodeInst;
^
sim.cpp(9) : Error: need explicit cast to convert
from: void (*C func)(const arr<double >)
to : void (*C func)(const arr<double >)
--- errorlevel 1
Works with VC8, Comeau, and EDG, too. I'd say it's a DM bug.

Cheers! --M

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles