Debian Codegraph @

cmake/cxx_tests/partial_ordering.cpp

raw
1 // DESCRIPTION
2 //
3 // Test to check whether the compiler supports partial ordering.
4 // In sync with AC_CXX_PARTIAL_ORDERING (2008-04-12).
5 //
6 // COPYLEFT
7 //
8 // Copyright (c) 2008 Todd Veldhuizen
9 // Copyright (c) 2009 Theo Papadopoulo <[email protected]>
10 // Copyright (c) 2008 Luc Maisonobe <[email protected]>
11 //
12 // Copying and distribution of this file, with or without modification, are
13 // permitted in any medium without royalty provided the copyright notice
14 // and this notice are preserved.
15
16 template<int N> struct I {};
17 template<class T> struct A {
18 int r;
19 template<class T1,class T2> int operator()(T1,T2) { r = 0; return r; }
20 template<int N1,int N2> int operator()(I<N1>, I<N2>) { r = 1; return r; }
21 };
22
23 int main() {
24 A<float> x,y;
25 I<0> a;
26 I<1> b;
27 return x(a,b)+y(float(),double());
28 }