![]() |
Adobe Source Libraries
1.43
|
Classes | |
struct | static_name_t |
struct | name_t |
struct | promote< static_name_t > |
struct | hash< adobe::name_t > |
struct | hash< adobe::static_name_t > |
struct | is_pod< adobe::name_t > |
Functions | |
constexpr static_name_t | operator""_name (const char *str, std::size_t n) |
std::unordered_map
on the backside that maps from a name_t
's hash to its string. When a name_t
is constructed, its hash is used to find the unique string pointer common to all name_t
s with that same string.reinterpret_cast
of its unique string pointer in the underlying string map. Both hashes will point to the same unique string in the string map, making for very fast conversion from a static_name_t to a name_t. constexpr static_name_t operator""_name | ( | const char * | str, |
std::size_t | n | ||
) |
User defined literal to convert a compile-time string into a static_name_t. It has been defined in the adobe::literals namespace to avoid namespace pollution.
using namespace adobe::literals; adobe::static_name_t foo("foo"_name); // OK, creation via user defined literal adobe::name_t bar(foo); // OK, implicit promotion to a name_t adobe::name_t baz("baz"_name); // OK, creation and then promotion
adobe
namespace itself uses the literals
namespace, so you do not need to specify using namespace adobe::literals
if you are already using namespace adobe
:using namespace adobe; static_name_t foo("foo"_name); // OK name_t bar("bar"_name); // OK