Skip to content

storage_for missing from single include #1800

@Tridacnid

Description

@Tridacnid

Describe the bug
single_include/catch2/catch.hpp appears to be missing some benchmarking symbols that appear in the docs. Others may also be missing.

Expected behavior
Compiling the example code should work:

TEST_CASE("BLAH")
{
    BENCHMARK_ADVANCED("construct")(Catch::Benchmark::Chronometer meter)
    {
        std::vector<Catch::Benchmark::storage_for<std::string>> storage(meter.runs());
        meter.measure([&](int i) { storage[i].construct("thing"); });
   }
}

Observed behavior
error: storage_for is not a member of Catch::Benchmark

Reproduction steps
Compile the following:

#define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_ENABLE_BENCHMARKING

#include <catch2/catch.hpp>

#include <vector>
#include <string>

TEST_CASE("BLAH")
{
    BENCHMARK_ADVANCED("construct")(Catch::Benchmark::Chronometer meter)
    {
        std::vector<Catch::Benchmark::storage_for<std::string>> storage(meter.runs());
        meter.measure([&](int i) { storage[i].construct("thing"); });
   }
}

Platform information:

  • Catch version: v2.10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions