C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Second draft of a __COUNTER__ proposal

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 26 Aug 2024 22:55:25 -0700
On Monday 26 August 2024 22:43:19 GMT-7 Robin Savonen Söderholm via Std-
Proposals wrote:
> template <int>
> auto _benchmarks = 0;
> #define BENCHMARK(fn) \
> auto _benchmarks<counter()> =
> (::benchmark::internal::RegisterBenchmarkInternal(#fn, fn));


template <auto> auto benchmark;

template auto benchmark<[]{}> = ( register1(): }
template auto benchmark<[]{}> = ( register2(): }
template auto benchmark<[]{}> = ( register3(): }

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2024-08-27 05:55:29