Skip to content

Commit

Permalink
feat: add dpp::snowflake::str() that returns string form of snowflake…
Browse files Browse the repository at this point in the history
… value
  • Loading branch information
braindigitalis committed Jul 31, 2023
1 parent 3c8b8a0 commit b2724fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/dpp/snowflake.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ class DPP_EXPORT snowflake final {
return value == 0;
}

/**
* @brief Returns the stringified version of the snowflake value
*
* @return std::string string form of snowflake value
*/
inline std::string str() const
{
return std::to_string(value);
}

/**
* @brief Operator less than, used for maps/unordered maps
* when the snowflake is a key value.
Expand Down

0 comments on commit b2724fd

Please sign in to comment.