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

Function generate

extlibs/catch/include/catch/catch.hpp:3988–3998  ·  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

3986 // the expression used in the typedef inside, when it is in
3987 // return type. Yeah.
3988 auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
3989 using UnderlyingType = typename decltype(generatorExpression())::type;
3990
3991 IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
3992 if (!tracker.hasGenerator()) {
3993 tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
3994 }
3995
3996 auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
3997 return generator.get();
3998 }
3999
4000} // namespace Generators
4001} // 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