message: Fix the RapidJSON problem with `std::size_t` by explicitly casting to uint64.
diff: @@ -108,7 +108,9 @@ std::ostream &operator<<(std::ostream &os, const rapidjson::Value &value)
  // helper for setting rapidjson object members
  template <typename T, typename NameType, typename Allocator>
  -void add_or_set_member(rapidjson::Value &object, NameType &&name, T &&value,
  +gko::xstd::enable_if_t<
  + !std::is_same<typename std::decay<T>::type, gko::size_type>::value, void>
  +add_or_set_member(rapidjson::Value &object, NameType &&name, T &&value,
  Allocator &&allocator)
  {
  if (object.HasMember(name)) {
  @@ -120,6 +122,30 @@ void add_or_set_member(rapidjson::Value &object, NameType &&name, T &&value,
  }
  +/**
  + @internal This is required to fix some MacOS problems (and possibly other
  + compilers). There is no explicit RapidJSON constructor for `std::size_t` so a
  + conversion to a known constructor is required to solve any ambiguity. See the
  + last comments of https://github.com/ginkgo-project/ginkgo/issues/270.
  + */
  +template <typename T, typename NameType, typename Allocator>
  +gko::xstd::enable_if_t<
  + std::is_same<typename std::decay<T>::type, gko::size_type>::value, void>
  +add_or_set_member(rapidjson::Value &object, NameType &&name, T &&value,
  + Allocator &&allocator)
  +{
  + if (object.HasMember(name)) {
  + object[name] =
  + std::forward<std::uint64_t>(static_cast<std::uint64_t>(value));
  + } else {
  + auto n = rapidjson::Value(name, allocator);
  + object.AddMember(
  + n, std::forward<std::uint64_t>(static_cast<std::uint64_t>(value)),
  + allocator);
  + }
  +}
  +
  +
  // helper for splitting a delimiter-separated list into vector of strings
  std::vector<std::string> split(const std::string &s, char delimiter = ',')
  {
  