Skip to content

UPtrList iterator does not skip empty entries

Functionality to add/problem to solve

Looping over an UPtrList:

    const lduInterfacePtrsList patches(lMesh.interfaces());

    for (const auto& pp : patches)
    {
        Pout<< "Patch:" << pp.type() << endl;
    }

it does not skip the empty entries (from uncoupled patches).

Target audience

Coders.

Proposal

Q: what if we want to set the entries so require walking over all.

Attached a little test app.

Test-lduMeshInterfacesCompilationError.C