use indexed in reduce and project, making index_mapper obsolete

This commit is contained in:
Hans Dembinski
2018-12-16 20:32:38 +01:00
parent f8b6b28975
commit 7d0bd00adb
8 changed files with 64 additions and 193 deletions

View File

@@ -24,6 +24,7 @@
#include <unordered_map>
#include <utility>
#include <vector>
#include "utility_allocator.hpp"
#include "utility_meta.hpp"
namespace bh = boost::histogram;
@@ -435,5 +436,17 @@ int main() {
BOOST_TEST(has_fixed_size<D>::value);
}
// make_default
{
struct A {};
auto a = make_default(A());
BOOST_TEST_TRAIT_TRUE((std::is_same<decltype(a), A>));
bh::tracing_allocator_db db;
using B = std::vector<int, bh::tracing_allocator<int>>;
B b = make_default(B(bh::tracing_allocator<int>(db)));
b.resize(100);
BOOST_TEST_EQ(db[&BOOST_CORE_TYPEID(int)].first, 100);
}
return boost::report_errors();
}