Skip to content

Commit

Permalink
Updated for real measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Oct 18, 2015
1 parent dfff9c4 commit 0d174bc
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/test/seq/tuple_bench.cpp.disable
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@
#include <type_traits>
#include <tuple>

// #define USE std
#define USE tao
// To benchmark the standard library's version, enable this:
// #define tao std

int main()
{
auto t = USE::tuple_cat( USE::make_tuple( 1, true ),
USE::make_tuple( 1.0 ),
USE::make_tuple(),
USE::make_tuple( 1UL, nullptr ) );
auto t = tao::tuple_cat( tao::make_tuple( 1, true ),
tao::make_tuple( 1.0 ),
tao::make_tuple(),
tao::make_tuple( 1UL, nullptr ) );

static_assert( std::is_same< decltype( t ), USE::tuple< int, bool, double, unsigned long, std::nullptr_t > >::value, "oops" );
static_assert( std::is_same< decltype( t ), tao::tuple< int, bool, double, unsigned long, std::nullptr_t > >::value, "oops" );

auto t2 = USE::tuple_cat( t, USE::make_tuple( 1, true ),
t, USE::make_tuple( 1.0 ),
t, USE::make_tuple(),
t, USE::make_tuple( 1UL, nullptr ) );
auto t2 = tao::tuple_cat( t, tao::make_tuple( 1, true ),
t, tao::make_tuple( 1.0 ),
t, tao::make_tuple(),
t, tao::make_tuple( 1UL, nullptr ) );

static_assert( USE::tuple_size< decltype( t2 ) >::value == 25, "oops" );
static_assert( tao::tuple_size< decltype( t2 ) >::value == 25, "oops" );

// auto t3 = USE::tuple_cat( t2, USE::make_tuple( 1, true ),
// t2, USE::make_tuple( 1.0 ),
// t2, USE::make_tuple(),
// t2, USE::make_tuple( 1UL, nullptr ) );
auto t3 = tao::tuple_cat( t2, tao::make_tuple( 1, true ),
t2, tao::make_tuple( 1.0 ),
t2, tao::make_tuple(),
t2, tao::make_tuple( 1UL, nullptr ) );

// static_assert( USE::tuple_size< decltype( t3 ) >::value == 105, "oops" );
static_assert( tao::tuple_size< decltype( t3 ) >::value == 105, "oops" );

// auto t4 = USE::tuple_cat( t3, USE::make_tuple( 1, true ),
// t2, USE::make_tuple( 1.0 ),
// t3, USE::make_tuple(),
// t2, USE::make_tuple( 1UL, nullptr ) );
auto t4 = tao::tuple_cat( t3, tao::make_tuple( 1, true ),
t2, tao::make_tuple( 1.0 ),
t3, tao::make_tuple(),
t2, tao::make_tuple( 1UL, nullptr ) );

// static_assert( USE::tuple_size< decltype( t4 ) >::value == 265, "oops" );
static_assert( tao::tuple_size< decltype( t4 ) >::value == 265, "oops" );
}

0 comments on commit 0d174bc

Please sign in to comment.