MCPcopy Create free account
hub / github.com/apache/trafficserver / generate

Function generate

lib/catch2/catch.hpp:4085–4095  ·  view source on GitHub ↗

Note: The type after -> is weird, because VS2015 cannot parse the expression used in the typedef inside, when it is in return type. Yeah.

Source from the content-addressed store, hash-verified

4083 // the expression used in the typedef inside, when it is in
4084 // return type. Yeah.
4085 auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
4086 using UnderlyingType = typename decltype(generatorExpression())::type;
4087
4088 IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo );
4089 if (!tracker.hasGenerator()) {
4090 tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
4091 }
4092
4093 auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
4094 return generator.get();
4095 }
4096
4097} // namespace Generators
4098} // namespace Catch

Callers

nothing calls this directly

Calls 5

acquireGeneratorTrackerFunction · 0.85
hasGeneratorMethod · 0.80
setGeneratorMethod · 0.80
getGeneratorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected