mirror of
https://github.com/boostorg/histogram.git
synced 2026-02-12 12:12:12 +00:00
use indexed in reduce and project, making index_mapper obsolete
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user