14 #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
15 #define IS_TRIVIALLY_CONSTRUCTIBLE std::has_trivial_default_constructor
17 #define IS_TRIVIALLY_CONSTRUCTIBLE std::is_trivially_default_constructible
25 static_assert(!IS_TRIVIALLY_CONSTRUCTIBLE<nontrivial_t>::value,
26 "expected nontrivial_t to not be trivially constructible");
29 static_assert(IS_TRIVIALLY_CONSTRUCTIBLE<trivial_t>::value,
30 "expected trivial_t to be trivially constructible");
68 for (
auto x = 0; x < 900; ++x) {
72 for (
auto x = 0; x < 101; ++x) {
77 for (
auto x = 0; x < 1000; ++x) {
84 #define PREVECTOR_TEST(name) \
85 static void Prevector##name##Nontrivial(benchmark::Bench &bench) { \
86 Prevector##name<nontrivial_t>(bench); \
88 BENCHMARK(Prevector##name##Nontrivial); \
89 static void Prevector##name##Trivial(benchmark::Bench &bench) { \
90 Prevector##name<trivial_t>(bench); \
92 BENCHMARK(Prevector##name##Trivial);
Double ended buffer combining vector and stream-like interfaces.
void Init(int nTypeIn, int nVersionIn)
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
ANKERL_NANOBENCH(NODISCARD) std Bench & batch(T b) noexcept
Sets the batch size.
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
void resize(size_type new_size)
static void PrevectorResize(benchmark::Bench &bench)
static void PrevectorDestructor(benchmark::Bench &bench)
static void PrevectorClear(benchmark::Bench &bench)
#define PREVECTOR_TEST(name)
static void PrevectorDeserialize(benchmark::Bench &bench)
SERIALIZE_METHODS(nontrivial_t, obj)