1 #ifndef BOOST_TEST_XOR_CONSTEXPR_HPP
2 #define BOOST_TEST_XOR_CONSTEXPR_HPP
4 // Copyright (c) 2019 Robert Ramey
6 // Distributed under the Boost Software License, Version 1.0. (See
7 // accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/safe_numerics/safe_integer.hpp>
12 template<class T1, class T2>
13 constexpr bool test_xor_constexpr(
18 using namespace boost::safe_numerics;
19 // if we don't expect the operation to pass, we can't
20 // check the constexpr version of the calculation so
21 // just return success.
22 if(expected_result == 'x')
26 safe_t<T1>(v1) ^ safe_t<T2>(v2);
27 return true; // correct result
30 #endif // BOOST_TEST_XOR_CONSTEXPR_HPP