Sun studio workaround for callback testcase

This commit is contained in:
William S Fulton 2015-01-31 23:00:22 +00:00
commit e44e3d3e39

View file

@ -57,6 +57,22 @@
return pf(a);
}
#if defined(__SUNPRO_CC)
// workaround for: Error: Could not find a match for foobar_T<T>(int, extern "C" int(*)(int)).
extern "C" {
typedef int (*foobar_int_int)(int a);
typedef double (*foobar_double_double)(double a);
};
template <class T>
int foobar_T(int a, foobar_int_int pf) {
return pf(a);
}
template <class T>
double foobar_T(double a, foobar_double_double pf) {
return pf(a);
}
#endif
template <class T>
const T& ident(const T& x) {
return x;