- Mesaj
- 693
- Çözümler
- 44
- Beğeni
- 438
- Puan
- 909
- Ticaret Puanı
- 0
merhabalar aşağıdaki hatayı alıyorum eklemeye çalıştığım sistem battlepas kütüphane dosyalarını mı eksik aldım acaba bilgisi olan varmı ?
şu şekilde değiştirip deneyin
C++:template<typename BasicJsonType> static typename BasicJsonType::size_type array_index(const string_t& s) { using size_type = typename BasicJsonType::size_type; // error condition (cf. RFC 6901, Sect. 4) if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && s[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, detail::concat("array index '", s, "' must not begin with '0'"), nullptr)); } // error condition (cf. RFC 6901, Sect. 4) if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && !(s[0] >= '1' && s[0] <= '9'))) { JSON_THROW(detail::parse_error::create(109, 0, detail::concat("array index '", s, "' is not a number")...
nereye eklemem gerekiyor#include <cstdlib> dahil edildi mi acaba
includelaranereye eklemem gerekiyor
hata veren dosyaların includelerinden bahsediyor onlarda ekliincludelara
const auto x = std::strtoull(token_buffer.data(), &endptr, 10);
bununla değiştirip
const auto x = std::stoull(std::string(token_buffer.begin(), token_buffer.end()));
dener misin includelara string ekle
#include <string>
tabikigeri alıp hpp dosyasını paylaşır mısın
const unsigned long long res = std::stoull(p);
template<typename BasicJsonType>
static typename BasicJsonType::size_type array_index(const string_t& s)
{
using size_type = typename BasicJsonType::size_type;
// error condition (cf. RFC 6901, Sect. 4)
if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && s[0] == '0'))
{
JSON_THROW(detail::parse_error::create(106, 0, detail::concat("array index '", s, "' must not begin with '0'"), nullptr));
}
// error condition (cf. RFC 6901, Sect. 4)
if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && !(s[0] >= '1' && s[0] <= '9')))
{
JSON_THROW(detail::parse_error::create(109, 0, detail::concat("array index '", s, "' is not a number"), nullptr));
}
const auto p = s.c_str();
std::size_t idx = 0;
unsigned long long res = 0;
try {
errno = 0;
res = std::stoull(s, &idx);
if (idx != s.size()) {
throw std::out_of_range("unresolved reference token '" + s + "'");
}
} catch (const std::invalid_argument& e) {
throw std::out_of_range("unresolved reference token '" + s + "'");
} catch (const std::out_of_range& e) {
throw std::out_of_range("unresolved reference token '" + s + "'");
}
if (res >= static_cast<unsigned long long>((std::numeric_limits<size_type>::max)())) // NOLINT(runtime/int)
{
JSON_THROW(detail::out_of_range::create(410, detail::concat("array index ", s, " exceeds size_type"), nullptr)); // LCOV_EXCL_LINE
}
return static_cast<size_type>(res);
}
şu şekilde değiştirip deneyin
C++:template<typename BasicJsonType> static typename BasicJsonType::size_type array_index(const string_t& s) { using size_type = typename BasicJsonType::size_type; // error condition (cf. RFC 6901, Sect. 4) if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && s[0] == '0')) { JSON_THROW(detail::parse_error::create(106, 0, detail::concat("array index '", s, "' must not begin with '0'"), nullptr)); } // error condition (cf. RFC 6901, Sect. 4) if (JSON_HEDLEY_UNLIKELY(s.size() > 1 && !(s[0] >= '1' && s[0] <= '9'))) { JSON_THROW(detail::parse_error::create(109, 0, detail::concat("array index '", s, "' is not a number"), nullptr)); } const auto p = s.c_str(); std::size_t idx = 0; unsigned long long res = 0; try { errno = 0; res = std::stoull(s, &idx); if (idx != s.size()) { throw std::out_of_range("unresolved reference token '" + s + "'"); } } catch (const std::invalid_argument& e) { throw std::out_of_range("unresolved reference token '" + s + "'"); } catch (const std::out_of_range& e) { throw std::out_of_range("unresolved reference token '" + s + "'"); } if (res >= static_cast<unsigned long long>((std::numeric_limits<size_type>::max)())) // NOLINT(runtime/int) { JSON_THROW(detail::out_of_range::create(410, detail::concat("array index ", s, " exceeds size_type"), nullptr)); // LCOV_EXCL_LINE } return static_cast<size_type>(res); }
const unsigned long long res = std::stoull(p);