#include <iostream>
 
template <typename T1, T1 value>
class Class1
{
public:
        template <typename T2>
        class Class2
        {
        public:
                explicit Class2(
                        T2 theValue
                ) : myValue(theValue)
                {
                        return;
                }
 
                template <typename T1Other, T1Other valueOther, typename T2Other>
                inline Class2(
                        typename Class1<T1Other, valueOther>::template Class2<T2Other> const & other
                ) {
                        myValue = other.myValue;
                }
 
                template <typename T1Other, T1Other valueOther, typename T2Other>
                inline bool operator==(
                        typename Class1<T1Other, valueOther>::template Class2<T2Other> const & other
                ) const {
                        return (myValue == other.myValue);
                }
 
        private:
                T2 myValue;
        };
 
        Class2<T1> const get() const
        {
                return Class2<T1>(value);
        }
};
 
int main(int argc, char * argv[])
{
        Class1<int, 1> c1;
        Class1<int, 2> c2;
 
        std::cout << (c1.get() == c2.get());
}