stephenberry / glaze

Extremely fast, in memory, JSON and interface library for modern C++
MIT License
1.2k stars 120 forks source link

Please include <climits> for CHAR_BIT #100

Closed toge closed 1 year ago

toge commented 1 year ago

glaze/api/hash.hpp uses CHAR_BIT.

   template <class T, T Value, size_t... Is>
   consteval auto make_array_impl(std::index_sequence<Is...>) {
      return std::array<char, sizeof(T)>{ static_cast<char>(((Value >> (CHAR_BIT * Is)) & 0xff))... };
   }

CHAR_BIT is defined in <climits>. Before 0.2.4, it was included by fmtlib. Because glaze doesn't require fmtlib since 0.2.4, there is no explicit place where includes <climits>. This causes compilation error in several environments.

Could you include <climits>? (ex. glaze/api/hash.hpp)

mwalcott3 commented 1 year ago

Done, thanks for pointing this out.