Adobe Source Libraries  1.43
Public Member Functions | Friends | List of all members
static_name_t Struct Reference

Public Member Functions

 operator bool () const
 

Friends

struct name_t
 
bool operator== (const static_name_t &x, const static_name_t &y)
 
bool operator!= (const static_name_t &x, const static_name_t &y)
 
bool operator< (const static_name_t &x, const static_name_t &y)
 
constexpr static_name_t literals::operator""_name (const char *str, std::size_t n)
 
std::ostream & operator<< (std::ostream &s, const static_name_t &name)
 

Detailed Description

A compile-time precursor to name_t.

This type is especially useful for setting up keys in advance, as work is done at compile-time to make conversion from a static_name_t to a name_t to be faster than creating a name_t at runtime. static_name_t does no work at runtime, instead leveraging c++11's constexpr feature to precompute token string hash values for immediate insertion into the underlying name table.

Note
You cannot create a static_name_t any way other than through the user defined literal. They can only be created at compile-time.
Complexity Guarantee(s)
The first time a static_name_t with a particular string is converted to a name_t is a O(log N) operation. Thereafter conversion of that same literal from a static_name_t to a name_t is on average O(1).
Promotes To
name_t

Definition at line 134 of file name.hpp.

Member Function Documentation

operator bool ( ) const
explicit
Returns
false iff the instance is equal to the empty string.
Complexity Guarantee(s)
O(1)

Friends And Related Function Documentation

friend struct name_t
friend

Definition at line 157 of file name.hpp.

bool operator== ( const static_name_t x,
const static_name_t y 
)
friend

Definition at line 144 of file name.hpp.

bool operator!= ( const static_name_t x,
const static_name_t y 
)
friend

Definition at line 148 of file name.hpp.

bool operator< ( const static_name_t x,
const static_name_t y 
)
friend
constexpr static_name_t literals::operator""_name ( const char *  str,
std::size_t  n 
)
friend
std::ostream& operator<< ( std::ostream &  s,
const static_name_t name 
)
friend