I want a constructor to accept any iterator having x
trait and referencing class y
.
Class(std::iterator<std::random_access_iterator_tag, MyClass*> it);
But when I try to pass such iterator, the compilation fails with Candidate constructor not viable: no known conversion from 'iterator' (aka '__deque_iterator<value_type, pointer, reference, __map_pointer, difference_type, __block_size>') to 'std::iterator<std::random_access_iterator_tag, MyClass *>'
.
The insertion code:
std::deque<MyClass*> collection_with_random_access_iterator{};
Class tmp(collection_with_random_access_iterator.begin());
What can I do here?