kabasset / Linx

Extensible ND image laboratory
Apache License 2.0
3 stars 0 forks source link

Simplify signature of PipelineStep #34

Closed kabasset closed 5 months ago

kabasset commented 5 months ago

Something similar to std::function would be great, e.g. instead of:

struct Step0 : PipelineStep<void, char> {};
struct Step1a : PipelineStep<Step0, short> {};
struct Step1b : PipelineStep<Step0, int> {};
struct Step2 : PipelineStep<std::tuple<Step1a, Step1b>, long>{};

we'd have:

struct Step0 : PipelineStep<char()> {};
struct Step1a : PipelineStep<short(Step0)> {};
struct Step1b : PipelineStep<int(Step0)> {};
struct Step2 : PipelineStep<long(Step1a, Step1b)>{};

We'd still have the Prerequisite as a std::tuple.

Note that std::function is not adequate because the argument types is not accessible.