cubos::core::data::StringTransparentEqual class final

Redefines equality function for std::string_view and std::string.

This class is used to allow heterogeneous lookup in unordered maps and sets.

Public functions

auto operator()(std::string_view svhs, std::string_view svvhs) const -> bool
Compares two string views for equality.
auto operator()(const std::string& shs, std::string_view svhs) const -> bool
Compares a string and a string view for equality.
auto operator()(std::string_view svhs, const std::string& shs) const -> bool
Compares a string view and a string for equality.
auto operator()(const std::string& shs, const std::string& sshs) const -> bool
Compares two strings for equality.

Function documentation

bool cubos::core::data::StringTransparentEqual::operator()(std::string_view svhs, std::string_view svvhs) const

Compares two string views for equality.

Parameters
svhs The first string view.
svvhs The second string view.
Returns True if the string views are equal, false otherwise.

bool cubos::core::data::StringTransparentEqual::operator()(const std::string& shs, std::string_view svhs) const

Compares a string and a string view for equality.

Parameters
shs The string.
svhs The string view.
Returns True if the string and string view are equal, false otherwise.

bool cubos::core::data::StringTransparentEqual::operator()(std::string_view svhs, const std::string& shs) const

Compares a string view and a string for equality.

Parameters
svhs The string view.
shs The string.
Returns True if the string view and string are equal, false otherwise.

bool cubos::core::data::StringTransparentEqual::operator()(const std::string& shs, const std::string& sshs) const

Compares two strings for equality.

Parameters
shs The first string.
sshs The second string.
Returns True if the strings are equal, false otherwise.