Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
with: add sfinae for nicer compile failure messages
Had we not been operating in the context of a CRTP, the sfinae would have been: ``` template <typename T, std::enable_if_t< std::is_same_v< T, typename decltype(std::decval<Deriv>().make())::value_type > , int> = 0 > ``` However, this cannot work, for then compilers will complain that we're referencing an incomplete type in the form of std::declval<Deriv>. We need to delay the type instantiation with the following form: ``` template <typename T, typename U = Deriv, std::enable_if_t< std::is_same_v< T, typename decltype(std::decval<U>().make())::value_type > , int> = 0 > ``` As far as I can tell, it's essentially this problem: https://stackoverflow.com/questions/43307462
- Loading branch information