When using range adaptors in a find algorithm, I have to repeat all the adaptor chain to get the corresponding end() iterator. e.g:
std::vector<size_t> numbers = { 10, 11, 12, 13, 14, 2, 1, 3,3,50, 55} ;
if ( find(numbers|reversed,99) != (numbers|reversed).end() )
//^adaptor chain repeated
{
std::cout << "FOUND!!!!!" << std::endl;
}
Is there a way to get the corresponding end iterator without having to repeat it again?