MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / generate

Function generate

tests/catch.hpp:3819–3829  ·  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

3817 // the expression used in the typedef inside, when it is in
3818 // return type. Yeah, ¯\_(ツ)_/¯
3819 auto generate( SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
3820 using UnderlyingType = typename decltype(generatorExpression())::type;
3821
3822 IGeneratorTracker& tracker = acquireGeneratorTracker( lineInfo );
3823 if (!tracker.hasGenerator()) {
3824 tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
3825 }
3826
3827 auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
3828 return generator.get();
3829 }
3830
3831} // namespace Generators
3832} // 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