For the following code, what should I return if I don't have something to return ? Currently, I do something like T() but I'm not sure it's correct and proper.
template<typename T1, typename T2>
tuple<T1, T2, bool> CBR<T1, T2>::getSomething(T1 t)
{
// here I I don't have something of time T2 or T2 to return
if( ... )
return make_tuple(T1(), T2(), false); // @FIXME
if( ... )
return make_tuple(something.tp, something.ts, false);
else
return make_tuple(something.tp, something.ts, true);
}
The "good" return paths will be unchanged; the "FIXME" one will become:
This can allow your class to be used with types that do not support default construction.