Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::utils::StringEqual Struct Reference

Transparent equality comparator for string types. More...

#include <string_hash.hpp>

Public Types

using is_transparent = void
 Enables heterogeneous lookup.

Public Member Functions

constexpr bool operator() (std::string_view lhs, std::string_view rhs) const noexcept
 Compares two string-like objects for equality.
bool operator() (const std::string &lhs, std::string_view rhs) const noexcept
 Compares std::string with std::string_view.
bool operator() (std::string_view lhs, const std::string &rhs) const noexcept
 Compares std::string_view with std::string.
bool operator() (const std::string &lhs, const std::string &rhs) const noexcept
 Compares two std::string objects.
bool operator() (const std::string &lhs, const char *rhs) const noexcept
 Compares std::string with C-style string.
constexpr bool operator() (const char *lhs, std::string_view rhs) const noexcept
 Compares C-style string with std::string_view.
bool operator() (const char *lhs, const std::string &rhs) const noexcept
 Compares C-style string with std::string.
constexpr bool operator() (std::string_view lhs, const char *rhs) const noexcept
 Compares std::string_view with C-style string.

Detailed Description

Transparent equality comparator for string types.

Enables heterogeneous lookup in unordered containers, allowing comparisons between different string types without temporary allocations. Supports std::string, std::string_view, and const char*.

Definition at line 55 of file string_hash.hpp.

Member Typedef Documentation

◆ is_transparent

Enables heterogeneous lookup.

Definition at line 56 of file string_hash.hpp.

Member Function Documentation

◆ operator()() [1/8]

bool helios::utils::StringEqual::operator() ( const char * lhs,
const std::string & rhs ) const
inlinenodiscardnoexcept

Compares C-style string with std::string.

Parameters
lhsLeft-hand side C-style string
rhsRight-hand side string
Returns
True if strings are equal, false otherwise

Definition at line 130 of file string_hash.hpp.

◆ operator()() [2/8]

bool helios::utils::StringEqual::operator() ( const char * lhs,
std::string_view rhs ) const
inlinenodiscardconstexprnoexcept

Compares C-style string with std::string_view.

Parameters
lhsLeft-hand side C-style string
rhsRight-hand side string view
Returns
True if strings are equal, false otherwise

Definition at line 119 of file string_hash.hpp.

◆ operator()() [3/8]

bool helios::utils::StringEqual::operator() ( const std::string & lhs,
const char * rhs ) const
inlinenodiscardnoexcept

Compares std::string with C-style string.

Parameters
lhsLeft-hand side string
rhsRight-hand side C-style string
Returns
True if strings are equal, false otherwise

Definition at line 108 of file string_hash.hpp.

◆ operator()() [4/8]

bool helios::utils::StringEqual::operator() ( const std::string & lhs,
const std::string & rhs ) const
inlinenodiscardnoexcept

Compares two std::string objects.

Parameters
lhsLeft-hand side string
rhsRight-hand side string
Returns
True if strings are equal, false otherwise

Definition at line 97 of file string_hash.hpp.

◆ operator()() [5/8]

bool helios::utils::StringEqual::operator() ( const std::string & lhs,
std::string_view rhs ) const
inlinenodiscardnoexcept

Compares std::string with std::string_view.

Parameters
lhsLeft-hand side string
rhsRight-hand side string view
Returns
True if strings are equal, false otherwise

Definition at line 75 of file string_hash.hpp.

◆ operator()() [6/8]

bool helios::utils::StringEqual::operator() ( std::string_view lhs,
const char * rhs ) const
inlinenodiscardconstexprnoexcept

Compares std::string_view with C-style string.

Parameters
lhsLeft-hand side string view
rhsRight-hand side C-style string
Returns
True if strings are equal, false otherwise

Definition at line 141 of file string_hash.hpp.

◆ operator()() [7/8]

bool helios::utils::StringEqual::operator() ( std::string_view lhs,
const std::string & rhs ) const
inlinenodiscardnoexcept

Compares std::string_view with std::string.

Parameters
lhsLeft-hand side string view
rhsRight-hand side string
Returns
True if strings are equal, false otherwise

Definition at line 86 of file string_hash.hpp.

◆ operator()() [8/8]

bool helios::utils::StringEqual::operator() ( std::string_view lhs,
std::string_view rhs ) const
inlinenodiscardconstexprnoexcept

Compares two string-like objects for equality.

Parameters
lhsLeft-hand side string
rhsRight-hand side string
Returns
True if strings are equal, false otherwise

Definition at line 64 of file string_hash.hpp.