Files
codeql/cpp/ql/test/library-tests/CPP-206/CPP-206.cpp
2018-08-02 17:53:23 +01:00

17 lines
388 B
C++

template <int I> struct Int {};
template <int Ia, int Ja>
constexpr bool operator==(Int<Ia> lhs, Int<Ja> rhs) { return Ia == Ja; }
template <int Ib, int Jb>
struct AsArraySize
{
char arr[Int<Ib>() == Int<Jb>()];
};
template <int Ic, int Jc>
constexpr int operator+(Int<Ic> lhs, Int<Jc> rhs) { return Ic + Jc; }
template <int Id, int Jd>
struct Sum : Int<Int<Id>() + Int<Jd>()> { };