I have the following code that compiles and works well:
template
T GetGlobal(const char *name);
template<>
int GetGlobal(cons
I would suggest not to actually provide an implementation, just a bare declaration of the method.
The other option would be to use a compile-time assert. Boost has a number of such beasts.
namespace mpl = boost::mpl;
BOOST_MPL_ASSERT((mpl::or_< boost::same_type,
boost::same_type >));
There is also its message version counterpart, which would help.