Consider the following code:
class Helper {
public:
template<typename taResult, typename taParam> static taResult Cast(const taParam par);
};
template<> inline __m256d Helper ::Cast(const __m256i par) {
return _mm256_castsi256_pd(par);
}
template<> inline __m256i Helper ::Cast(const __m256d par) {
return _mm256_castpd_si256(par);
}
I want to add to the Helper
a function to handle casts where the parameter and the return types are equals. All my attempts to specialize/overload so far have failed with different compilation errors.
Something like the following in the class body:
template<typename T> static T Cast(const T par) {
return par;
}