Index: benchmarks/CartesianBenchmarks.hpp =================================================================== --- /dev/null +++ benchmarks/CartesianBenchmarks.hpp @@ -0,0 +1,94 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#include +#include +#include + +#include "benchmark/benchmark.h" +#include "../test/support/test_macros.h" + +namespace internal { + +template +struct EnumValue : std::integral_constant(I)> { + static std::string name() { return std::string("_") + D::Names[I]; } +}; + +template +struct MakeEnumValueTuple : MakeEnumValueTuple {}; + +template +struct MakeEnumValueTuple { + using type = std::tuple...>; +}; + +template +static auto skip(int) -> decltype(T::skip()) { + return T::skip(); +} +template +static bool skip(char) { + return false; +} + +template