7 #ifndef ALPS_NUMERIC_CHECK_SIZE_HEADER 8 #define ALPS_NUMERIC_CHECK_SIZE_HEADER 13 #include <boost/array.hpp> 15 #include <type_traits> 25 template <
class X,
class Y>
27 resize_same_as(X&,
const Y&) {}
29 template <
class X,
class Y>
31 resize_same_as(X& a,
const Y& y) {
35 template<
typename T,
typename U, std::
size_t N>
36 inline void resize_same_as(boost::array<T, N> & a, boost::array<U, N>
const & y) {}
39 template<
typename T,
typename U>
42 template<
typename T,
typename U>
43 inline void check_size(std::vector<T> & a, std::vector<U>
const & b) {
45 detail::resize_same_as(a, b);
46 else if(a.size() != b.size())
47 boost::throw_exception(std::runtime_error(
"vectors must have the same size!" +
ALPS_STACKTRACE));
50 template<
typename T,
typename U, std::
size_t N, std::
size_t M>
51 inline void check_size(boost::array<T, N> & a, boost::array<U, M>
const & b) {
52 boost::throw_exception(std::runtime_error(
"boost::array s must have the same size!" +
ALPS_STACKTRACE));
55 template<
typename T,
typename U, std::
size_t N>
56 inline void check_size(boost::array<T, N> & a, boost::array<U, N>
const & b) {}
void check_size(T &, U const &)
static constexpr bool value