#include <iostream>
#include <iterator>
#include <map>
#include <functional>
#include <type_traits>

int main()
{
    /////////////// scary iterators check /////////////////////////

    using map_type_one = std::map< int, char, std::less<int> > ;

    // container with same value_type etc, but different comparator
    using map_type_two = std::map< int, char, std::greater<int> > ;

    bool containers_are_of_same_type = std::is_same<map_type_one,map_type_two>::value ;
    std::cout << "containers are of same type? " << std::boolalpha
               << containers_are_of_same_type << '\n' ; // false

    using iter_type_one = map_type_one::iterator ;
    using iter_type_two = map_type_two::iterator ;

    // is iter_type_one the same as iter_type_two ?
    bool iterators_are_of_same_type = std::is_same<iter_type_one,iter_type_two>::value ;
    std::cout << "iterators are of same type? "
               << iterators_are_of_same_type << '\n' ; // true

    /////////////// OutputIterator EqualityComparable check /////////////////////////

    using iterator = std::ostream_iterator<char> ;
    iterator one(std::cout) ;
    iterator two(std::cout) ;
    one = two ; // fine: CopyAssignable
    // one == two ; // error: not EqualityComparable

}
