You can use overload, if you change the implementation.
template
class Foo
{
public:
template
CT function() { return helper((CT*)0); }
private:
template
CT helper(CT*);
T helper(T*) { return (T)0.0; }
bool helper(bool*) { return false; }
};
Simple and easy :)