Edit: noticed you're using these in another place (`compatible` implementation), so perhaps there's a reason for a different approach?
Edit: noticed you're using these in another place (`compatible` implementation), so perhaps there's a reason for a different approach?
Ideally you'd want to do enable_if< conditionA || conditionB >, but of course if one of the conditions fails to evaluate, the overload is ignored. So you have to split out the conditions and them merge them back together later on.
We could use true_type / false_type, but they have equivalent sizes. So unlike the function version that only needs one test and can just take the return type directly, the test at the end would then have to become std::is_same<decltype(test1<U>(0)), std::true_type>::value | std::is_same<decltype(test2<U>(0)), std::true_type>::value.
I still think we can do better than even this, so I'll have to keep working at it.