• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright Nick Thompson, 2017
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 #include <boost/math/concepts/std_real_concept.hpp>
8 #include <boost/math/tools/polynomial.hpp>
9 #include <boost/multiprecision/cpp_int.hpp>
10 
11 template <class T>
check_concepts()12 bool check_concepts()
13 {
14    boost::math::tools::polynomial<T> a(2), b(3), c(4);
15 
16    a += b;
17    a -= b;
18    a *= b;
19    a /= b;
20    a %= b;
21    a = c;
22    a += b + c;
23    a += b - c;
24    a += b * c;
25    a += b / c;
26    a += b % c;
27 
28    int i = 4;
29 
30    a += i;
31    a -= i;
32    a *= i;
33    a /= i;
34    a %= i;
35    a += b + i;
36    a += i + b;
37    a += b - i;
38    a += i - b;
39    a += b * i;
40    a += i * b;
41    a += b / i;
42    a += b % i;
43 
44    bool bb = false;
45    bb |= a == b;
46    bb |= a != b;
47 
48    return bb;
49 }
50 
main()51 int main()
52 {
53    check_concepts<int>();
54    check_concepts<boost::multiprecision::cpp_int>();
55    return 0;
56 }
57 
58