Hello, I have a problem with implementing my own container similar to std :: map.
at the moment I have an iterator and const_iterator I need to make them:
- is_reference - here, as I understand it, you just need to return & iterator
is_convertible - the biggest problem here. For example, how to do the conversion so that the code below worked, I can not imagine.
using mapp = Map<int, int>; using mapp_it1 = mapp::const_iterator; using mapp_it2 = mapp::iterator; mapp_it1 tmp1; mapp_it2 tmp2; static_assert(std::is_convertible<mapp_it2, mapp_it1>::value, "iterator is not convertible to const iterator"); tmp1 == (mapp_it1)tmp2; //Вот этот момент tmp1 != tmp2;I will be very grateful for the hint, and a possible example.