MCPcopy Create free account
hub / github.com/RenderKit/embree / generate

Function generate

tutorials/external/catch.hpp:3669–3679  ·  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

3667 // the expression used in the typedef inside, when it is in
3668 // return type. Yeah.
3669 auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
3670 using UnderlyingType = typename decltype(generatorExpression())::type;
3671
3672 IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
3673 if (!tracker.hasGenerator()) {
3674 tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
3675 }
3676
3677 auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
3678 return generator.get();
3679 }
3680
3681} // namespace Generators
3682} // 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