On Apr 20, 12:34 pm, SzH <szhor...@gmail.com> wrote:
> 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 T> class arr { T x; };
>
> template<void (*D)(const arr<double>)> class ode { };
>
> void fun(const arr<double>) { }
>
> int main() {
> ode<fun> odeInst;
> return 0;
>
> }
>
> dmc gives the following error message:
>
> ode<fun> odeInst;
> ^
> 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
|