Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
strings::AsciiCaseInsensitiveHash Struct Reference

#include <case.h>

Public Types

using is_transparent = void
 

Public Member Functions

size_t operator() (absl::string_view s) const
 

Detailed Description

AsciiCaseInsensitiveHash and AsciiCaseInsensitiveEq

Performs a case-insensitive hash/eq absl::string_view operations. This function objects are useful as a template parameter for hash set/map of absl::string_view-compatible types, if uniqueness of keys is case-insensitive. Can be used for heterogeneous lookups in absl associative containers. Example:

absl::flat_hash_map<std::string, std::string, AsciiCaseInsensitiveHash, AsciiCaseInsensitiveEq> map; absl::string_view key = ...; auto it = map.find(key);

Definition at line 106 of file case.h.

Member Typedef Documentation

◆ is_transparent

Definition at line 107 of file case.h.

Member Function Documentation

◆ operator()()

size_t strings::AsciiCaseInsensitiveHash::operator() ( absl::string_view s) const

return absl::HashOf(absl::AsciiStrToLower(s));

Definition at line 102 of file case.cc.


The documentation for this struct was generated from the following files: