MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / generate

Function generate

test/expected/catch.hpp:4042–4052  ·  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

4040 // the expression used in the typedef inside, when it is in
4041 // return type. Yeah.
4042 auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
4043 using UnderlyingType = typename decltype(generatorExpression())::type;
4044
4045 IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
4046 if (!tracker.hasGenerator()) {
4047 tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
4048 }
4049
4050 auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
4051 return generator.get();
4052 }
4053
4054} // namespace Generators
4055} // 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