Functions with C linkage and functions with C++ linkage
need to have different types.

Why are you trying to feed a "C linkage" function into
a C++ template?

--chris


Yong Sun wrote:
> //extern "C" void foo (void*);
> extern void foo (void*);
> 
> template <typename T, void(*cb)(T*)> class Test {};
> typedef Test<void, foo> TestVoid;
> 
> SunStudio C++ compiler will fail if we uncomment the 1st line, and reports:
> 
> line 5: Error: Template parameter cb requires an expression of type 
> void(*)(void*).
> 1 Error(s) detected.
> --
> This message posted from opensolaris.org
> _______________________________________________
> tools-compilers mailing list
> tools-compilers at opensolaris.org

Reply via email to