yosh-matsuda / cpp-yyjson

Ultra-fast and intuitive C++ JSON reader/writer with yyjson backend
MIT License
63 stars 6 forks source link

报错//// #7

Closed shoushouzhuo closed 1 year ago

shoushouzhuo commented 1 year ago

F:/wyProj2023/common/cpp_yyjson.hpp:3188:78: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = char; _Alloc = std::allocator; std::vector<_Tp, Alloc>::iterator = std::vector::iterator]' 3188 | [[nodiscard]] constexpr auto begin() noexcept { return buf.begin(); } | ~~^~

yosh-matsuda commented 1 year ago

@shoushouzhuo Please make sure that your compiler fully supports C++20.

NG: GCC 11 https://godbolt.org/z/hKv9jznMo OK: GCC 12 https://godbolt.org/z/TYrnc4szj