12 #include <type_traits>
16 #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
17 #define IS_TRIVIALLY_CONSTRUCTIBLE std::has_trivial_default_constructor
19 #define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivially_default_constructible
27 static_assert(!IS_TRIVIALLY_CONSTRUCTIBLE<nontrivial_t>::value,
28 "expected nontrivial_t to not be trivially constructible");
31 static_assert(IS_TRIVIALLY_CONSTRUCTIBLE<trivial_t>::value,
32 "expected trivial_t to be trivially constructible");
38 for (
auto x = 0; x < 1000; ++x) {
52 for (
auto x = 0; x < 1000; ++x) {
69 for (
auto x = 0; x < 1000; ++x) {
78 #define PREVECTOR_TEST(name, nontrivops, trivops) \
79 static void Prevector ## name ## Nontrivial(benchmark::State& state) { \
80 PrevectorResize<nontrivial_t>(state); \
82 BENCHMARK(Prevector ## name ## Nontrivial, nontrivops); \
83 static void Prevector ## name ## Trivial(benchmark::State& state) { \
84 PrevectorResize<trivial_t>(state); \
86 BENCHMARK(Prevector ## name ## Trivial, trivops);
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
void resize(size_type new_size)
#define PREVECTOR_TEST(name, nontrivops, trivops)
void PrevectorResize(benchmark::State &state)
SERIALIZE_METHODS(nontrivial_t, obj)