Say i got template function like this
template <typename T> bool func(T a)
{
if(a.X())
return a.Y();
return false;
}
Now every class i use as parameter to this function has function X(), but not every class i use as parameter has function Y(). However if function a.X() returns true then i have guaranteed that given class has function Y(). Can i make this code compile somehow since i know that function Y() which compiler is whining about missing on certain types will never be called? This function is in reality really big and types used are many so making a number of specializations is impractical.