I want to get rid of all the unholy enable_if
s in my templates and replace them with C++20 concepts, however there's barely any info on concepts and the syntax changes with just about any source I read.
Here's a function that takes two iterators of any container with MyClass
values:
template <class IteratorType, typename = std::enable_if<std::is_same<
typename std::iterator_traits<IteratorType>::value_type,
MyClass
>::value, void>>
void myFunction( IteratorType begin, IteratorType end ) {}
I know this function could be converted using concepts but I just can't find good leads to start with.
std::same_as
in case other constraints might one day be involved. – Arellano