Skip to content

How to create a dynamic subflow from within an for_each_index operation ie: nested for_each_index. #328

@bradphelan

Description

@bradphelan

The example given in the docs is

taskflow.for_each_index(0, 100,  2, [](int i) { });  // 50 loops with a + step

which represents

for(size_t i = 0; i<100;i+=1){}

but how to do a nested loop given that the callback for for_each_index does not pass a subflow object in?

for(size_t i = 0; i<5;i+=1){
    for(size_t j = 0; i < 100; j+=1){
        someTask(i,j);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions