Skip to content

Is there a string size limitation when creating the lookup table? #6

@FranciscoThiesen

Description

@FranciscoThiesen

Hi, @krzysztof-jusiak

This is a really cool library! When reading the code I was left with 2 questions:

  • Is there a limitation on the string sizes that we pass to the lookup table? This is relevant for the use case that I am working with. And if there is such a limitation, is there a way to specify a fallback logic for when the limit is surpassed?
  • Is there any harm/slow-down at not passing a <key, value> pair and using just a list of keys? Like for example:
constexpr auto dict = std::array<std::string_view, 3>{
    "make"sv,
    "model"sv,
    "year"sv
};

int main() {
    static_assert(mph::find<dict>("make") == true);
    static_assert(mph::find<dict>("model") == true);
    static_assert(mph::find<dict>("year") == true);
    static_assert(mph::find<dict>("unknown") == false);
}

Thanks,
Francisco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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