Skip to content

findWithDefault #5

@baconpaul

Description

@baconpaul

One thing I find myself doing a lot is

 if (bitmap_file_registry.find(filename) == bitmap_file_registry.end())
        return nullptr;
    return bitmap_file_registry.at(filename);

and what I really wanted to add is (basically)

T& findWithDefault(const C& container, const T& defValue)

so I could write that as

return sst::cpputils::findWithDefault(bitmap_file_registry, filename, nullptr)

just writing that here so I remember :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions