// Copyright 2019 Hans Dembinski // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include namespace dtl = boost::histogram::detail; int main() { using boost::histogram::weight_type; struct A1 { void operator()(); }; BOOST_TEST_NOT(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple<>); struct A2 { void operator()(int, double); }; BOOST_TEST_NOT(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple); struct A3 { void operator()(); void operator()(weight_type); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple<>); struct A4 { void operator()(int, double, char); void operator()(weight_type, int, double, char); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple); struct A5 { void operator()(const weight_type, int); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple); struct A6 { void operator()(const weight_type&, const int); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple); struct A7 { void operator()(weight_type&&, int&&); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple); struct B { int operator+=(int); }; BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(typename dtl::accumulator_traits::args, std::tuple<>); BOOST_TEST(dtl::accumulator_traits::weight_support); BOOST_TEST_TRAIT_SAME(dtl::accumulator_traits::args, std::tuple<>); return boost::report_errors(); }