#include <iostream>

template<typename T, size_t N>
constexpr std::size_t arraySize(T (&)[N]) noexcept{
    return N;
}


template<typename T>
class V{
public:
    using type = V<T>;
    constexpr V(T x, T y) noexcept : x(x), y(y) {}
    friend constexpr type operator+(const type& lhs, const type& rhs) noexcept{
        return std::move ( type(lhs.x + rhs.x, lhs.y + rhs.y) );
    }
    constexpr T lengthSqare () noexcept {return x*x+y*y;};
    T x,y;
};

int main(int argc, const char * argv[]) {
    char a1[(V<int>(1,2) + V<int>(3,5)).x];
    char a2[V<int>(2,2).lengthSqare()];
    std::cout<<"Some compile time vec+ "<<arraySize(a1)<<std::endl;
    std::cout<<"And compile time lenght^2 is: "<<arraySize(a2)<<std::endl;
}