Skip to content

Commit

Permalink
because bool is a std::integral
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishura4 committed Oct 9, 2023
1 parent 293a284 commit f1ee131
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/dpp/snowflake.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DPP_EXPORT snowflake final {
* @throw dpp::logic_exception on assigning a negative value. The function is noexcept if the type given is unsigned
* @param snowflake_val snowflake value as an integer type
*/
template <typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
template <typename T, typename = std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, bool>>>
constexpr snowflake(T snowflake_val) noexcept(std::is_unsigned_v<T>) : value(static_cast<std::make_unsigned_t<T>>(snowflake_val)) {
/**
* we cast to the unsigned version of the type given - this maintains "possible loss of data" warnings for sizeof(T) > sizeof(value)
Expand Down

0 comments on commit f1ee131

Please sign in to comment.