More doc improvements

This commit is contained in:
Hans Dembinski
2019-04-28 12:22:49 +02:00
committed by GitHub
parent 22ec005290
commit 073dffdf09
16 changed files with 278 additions and 178 deletions

View File

@@ -3,6 +3,8 @@
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
# keep in sync with Jamfile
boost_test(TYPE compile-fail SOURCES make_histogram_fail0.cpp)
boost_test(TYPE compile-fail SOURCES make_histogram_fail1.cpp)
boost_test(TYPE run SOURCES algorithm_project_test.cpp
LIBRARIES Boost::histogram Boost::core)
boost_test(TYPE run SOURCES algorithm_reduce_test.cpp

View File

@@ -34,6 +34,8 @@ project
;
alias cxx14 :
[ compile-fail make_histogram_fail0.cpp ]
[ compile-fail make_histogram_fail1.cpp ]
[ run algorithm_project_test.cpp ]
[ run algorithm_reduce_test.cpp ]
[ run algorithm_sum_test.cpp ]

View File

@@ -134,19 +134,6 @@ int main() {
BOOST_TEST_THROWS(detail::bincount(v), std::overflow_error);
}
// common_container
{
using A = std::array<int, 10>;
using B = std::vector<int>;
using C = std::map<std::size_t, int>;
BOOST_TEST_TRAIT_SAME(detail::common_container<A, B>, A);
BOOST_TEST_TRAIT_SAME(detail::common_container<B, A>, A);
BOOST_TEST_TRAIT_SAME(detail::common_container<A, C>, A);
BOOST_TEST_TRAIT_SAME(detail::common_container<C, A>, A);
BOOST_TEST_TRAIT_SAME(detail::common_container<C, B>, B);
BOOST_TEST_TRAIT_SAME(detail::common_container<B, C>, B);
}
// common_storage
{
BOOST_TEST_TRAIT_SAME(

View File

@@ -513,6 +513,8 @@ void run_tests() {
BOOST_TEST_EQ(h.at(j11), 1);
BOOST_TEST_EQ(h[j11], 1);
BOOST_TEST_THROWS((void)h.at(j111), std::invalid_argument);
int j13[] = {1, 3};
BOOST_TEST_THROWS((void)h.at(j13), std::out_of_range);
// tuple with weight
h(std::make_tuple(weight(2), 0, 2.0));

View File

@@ -0,0 +1,14 @@
// 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 <boost/histogram/make_histogram.hpp>
using namespace boost::histogram;
int main() {
// argument is not an axis
(void)make_histogram(std::vector<int>{});
}

View File

@@ -0,0 +1,16 @@
// 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 <boost/histogram/axis/regular.hpp>
#include <boost/histogram/make_histogram.hpp>
#include <vector>
using namespace boost::histogram;
int main() {
// first and second arguments switched
(void)make_histogram_with(axis::regular<>(3, 0, 1), std::vector<int>{});
}