Skip to content

Use std::less<> for Labels to enable heterogeneous lookup on C++14+#750

Open
aeroyorch wants to merge 1 commit into
jupp0r:masterfrom
aeroyorch:labels-transparent-comparator
Open

Use std::less<> for Labels to enable heterogeneous lookup on C++14+#750
aeroyorch wants to merge 1 commit into
jupp0r:masterfrom
aeroyorch:labels-transparent-comparator

Conversation

@aeroyorch

Copy link
Copy Markdown

No description provided.

@aeroyorch aeroyorch force-pushed the labels-transparent-comparator branch from a0bf6de to 859b829 Compare June 4, 2026 19:55
@aeroyorch aeroyorch force-pushed the labels-transparent-comparator branch from 859b829 to 5947bd0 Compare June 4, 2026 19:58
@gjasny

gjasny commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Hello,

do you have a benchmark that shows improvements with this change? I'm a little bit hesitant to make the public ABI dependent on __cpp_lib_generic_associative_lookup. If the change is worth it, I'd raise the required C++ standard to 14 (or newer).

But most of the comparisons happen with Labels and thus with std::string.

Thanks,
Gregor

@aeroyorch

Copy link
Copy Markdown
Author

Hello,

do you have a benchmark that shows improvements with this change? I'm a little bit hesitant to make the public ABI dependent on __cpp_lib_generic_associative_lookup. If the change is worth it, I'd raise the required C++ standard to 14 (or newer).

But most of the comparisons happen with Labels and thus with std::string.

Thanks,
Gregor

Ok, I'll try to put together a benchmark next week. I don't expect a big improvement inside the library itself, but it could help users who use the Labels alias directly, especially when doing lookups with std::string_view or string literals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants