Giter Site home page Giter Site logo

Comments (6)

meftunca avatar meftunca commented on September 25, 2024 1

You're really fast :D

from glaze.

meftunca avatar meftunca commented on September 25, 2024

I also get this error when I want to write for ndjson

external/_main~conan_extension~glaze/include/glaze/util/dtoa.hpp:998:20: error: assigning to 'std::byte' from incompatible type 'char'
         *buffer = '-';
                   ^~~
external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:88:38: note: in instantiation of function template specialization 'glz::to_chars<double, std::byte>' requested here
               const auto end = glz::to_chars(start, value);
                                     ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:225:29: note: in instantiation of function template specialization 'glz::detail::write_chars::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
               write_chars::op<Opts>(value, ctx, b, ix);
                            ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:31:55: note: in instantiation of function template specialization 'glz::detail::to_json<double>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
            to_json<std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                      ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:854:35: note: in instantiation of function template specialization 'glz::detail::write<10>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, double &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
                     write<json>::op<Opts>(val, ctx, args...);
                                  ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:44:34: note: in instantiation of function template specialization 'glz::detail::to_json<std::variant<std::nullptr_t, double, std::string, bool, std::vector<glz::json_t>, std::map<std::string, glz::json_t, std::less<void>>>>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, unsigned long &, std::variant<std::nullptr_t, double, std::string, bool, std::vector<glz::json_t>, std::map<std::string, glz::json_t, std::less<void>>> &, glz::context &>' requested here
            to_json<V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
                                 ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:31:55: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
            to_json<std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                      ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:161:50: note: in instantiation of function template specialization 'glz::detail::to_ndjson<std::vector<glz::json_t>>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, unsigned long &, std::vector<glz::json_t> &, glz::context &>' requested here
            to_ndjson<std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                 ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:24:44: note: in instantiation of function template specialization 'glz::detail::write<100>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
      detail::write<Opts.format>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
                                           ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:56:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>, glz::context &>' requested here
      return write<Opts>(std::forward<T>(value), buffer, ctx);
             ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:298:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>>' requested here
      return write<opts{.format = ndjson}>(std::forward<T>(value), std::forward<Buffer>(buffer));
             ^
src/resourcesPool/memoizedFile.cc:99:22: note: in instantiation of function template specialization 'glz::write_ndjson<std::vector<glz::json_t> &, std::vector<std::byte> &>' requested here
      auto ec = glz::write_ndjson(m_json_, data);
                     ^
In file included from src/resourcesPool/memoizedFile.cc:1:
In file included from ./src/resourcesPool/memoizedFile.h:6:
In file included from external/_main~conan_extension~glaze/include/glaze/glaze.hpp:35:
In file included from external/_main~conan_extension~glaze/include/glaze/binary.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/custom.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/read.hpp:7:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/skip.hpp:8:
In file included from external/_main~conan_extension~glaze/include/glaze/core/read.hpp:9:
In file included from external/_main~conan_extension~glaze/include/glaze/core/common.hpp:27:
In file included from external/_main~conan_extension~glaze/include/glaze/util/validate.hpp:10:
In file included from external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:11:
external/_main~conan_extension~glaze/include/glaze/util/dtoa.hpp:903:16: error: assigning to 'std::byte' from incompatible type 'uint8_t' (aka 'unsigned char')
      buf[0] = uint8_t(a + '0');
               ^~~~~~~~~~~~~~~~
external/_main~conan_extension~glaze/include/glaze/util/dtoa.hpp:1041:31: note: in instantiation of function template specialization 'glz::write_u64_len_15_to_17_trim<std::byte>' requested here
               auto num_end = write_u64_len_15_to_17_trim(num_hdr, sig_dec);
                              ^
external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:88:38: note: in instantiation of function template specialization 'glz::to_chars<double, std::byte>' requested here
               const auto end = glz::to_chars(start, value);
                                     ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:225:29: note: in instantiation of function template specialization 'glz::detail::write_chars::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
               write_chars::op<Opts>(value, ctx, b, ix);
                            ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:31:55: note: in instantiation of function template specialization 'glz::detail::to_json<double>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
            to_json<std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                      ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:854:35: note: in instantiation of function template specialization 'glz::detail::write<10>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, double &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
                     write<json>::op<Opts>(val, ctx, args...);
                                  ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:44:34: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
            to_json<V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
                                 ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:161:50: note: in instantiation of function template specialization 'glz::detail::to_ndjson<std::vector<glz::json_t>>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, unsigned long &, std::vector<glz::json_t> &, glz::context &>' requested here
            to_ndjson<std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                 ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:24:44: note: in instantiation of function template specialization 'glz::detail::write<100>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
      detail::write<Opts.format>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
                                           ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:56:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>, glz::context &>' requested here
      return write<Opts>(std::forward<T>(value), buffer, ctx);
             ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:298:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>>' requested here
      return write<opts{.format = ndjson}>(std::forward<T>(value), std::forward<Buffer>(buffer));
             ^
src/resourcesPool/memoizedFile.cc:99:22: note: in instantiation of function template specialization 'glz::write_ndjson<std::vector<glz::json_t> &, std::vector<std::byte> &>' requested here
      auto ec = glz::write_ndjson(m_json_, data);
                     ^
In file included from src/resourcesPool/memoizedFile.cc:1:
In file included from ./src/resourcesPool/memoizedFile.h:6:
In file included from external/_main~conan_extension~glaze/include/glaze/glaze.hpp:35:
In file included from external/_main~conan_extension~glaze/include/glaze/binary.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/custom.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/read.hpp:7:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/skip.hpp:8:
In file included from external/_main~conan_extension~glaze/include/glaze/core/read.hpp:9:
In file included from external/_main~conan_extension~glaze/include/glaze/core/common.hpp:27:
In file included from external/_main~conan_extension~glaze/include/glaze/util/validate.hpp:10:
In file included from external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:11:
external/_main~conan_extension~glaze/include/glaze/util/dtoa.hpp:1042:28: error: assigning to 'std::byte' from incompatible type 'char'
               buffer[0] = '0';
                           ^~~
external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:88:38: note: in instantiation of function template specialization 'glz::to_chars<double, std::byte>' requested here
               const auto end = glz::to_chars(start, value);
                                     ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:225:29: note: in instantiation of function template specialization 'glz::detail::write_chars::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
               write_chars::op<Opts>(value, ctx, b, ix);
                            ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:31:55: note: in instantiation of function template specialization 'glz::detail::to_json<double>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, double &, glz::context &, unsigned long &>' requested here
            to_json<std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                      ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:854:35: note: in instantiation of function template specialization 'glz::detail::write<10>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, double &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
                     write<json>::op<Opts>(val, ctx, args...);
                                  ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:44:34: note: in instantiation of function template specialization 'glz::detail::to_json<std::variant<std::nullptr_t, double, std::string, bool, std::vector<glz::json_t>, std::map<std::string, glz::json_t, std::less<void>>>>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, unsigned long &, std::variant<std::nullptr_t, double, std::string, bool, std::vector<glz::json_t>, std::map<std::string, glz::json_t, std::less<void>>> &, glz::context &>' requested here
            to_json<V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
                                 ^
external/_main~conan_extension~glaze/include/glaze/json/write.hpp:31:55: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
            to_json<std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                      ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:161:50: note: in instantiation of function template specialization 'glz::detail::to_ndjson<std::vector<glz::json_t>>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<std::byte> &, unsigned long &, std::vector<glz::json_t> &, glz::context &>' requested here
            to_ndjson<std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
                                                 ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:24:44: note: in instantiation of function template specialization 'glz::detail::write<100>::op<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, glz::context &, std::vector<std::byte> &, unsigned long &>' requested here
      detail::write<Opts.format>::template op<Opts>(std::forward<T>(value), ctx, buffer, ix);
                                           ^
external/_main~conan_extension~glaze/include/glaze/core/write.hpp:56:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>, glz::context &>' requested here
      return write<Opts>(std::forward<T>(value), buffer, ctx);
             ^
external/_main~conan_extension~glaze/include/glaze/json/ndjson.hpp:298:14: note: in instantiation of function template specialization 'glz::write<{100, false, true, true, true, false, false, 32, 3, true, false, true, false, false, false, 0, 0, false, false, false, false, false, false, true, false, false, true, true, false, false, false, false, true, false, false, false}, std::vector<glz::json_t> &, std::vector<std::byte>>' requested here
      return write<opts{.format = ndjson}>(std::forward<T>(value), std::forward<Buffer>(buffer));
             ^
src/resourcesPool/memoizedFile.cc:99:22: note: in instantiation of function template specialization 'glz::write_ndjson<std::vector<glz::json_t> &, std::vector<std::byte> &>' requested here
      auto ec = glz::write_ndjson(m_json_, data);
                     ^
In file included from src/resourcesPool/memoizedFile.cc:1:
In file included from ./src/resourcesPool/memoizedFile.h:6:
In file included from external/_main~conan_extension~glaze/include/glaze/glaze.hpp:35:
In file included from external/_main~conan_extension~glaze/include/glaze/binary.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/custom.hpp:6:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/read.hpp:7:
In file included from external/_main~conan_extension~glaze/include/glaze/binary/skip.hpp:8:
In file included from external/_main~conan_extension~glaze/include/glaze/core/read.hpp:9:
In file included from external/_main~conan_extension~glaze/include/glaze/core/common.hpp:27:
In file included from external/_main~conan_extension~glaze/include/glaze/util/validate.hpp:10:
In file included from external/_main~conan_extension~glaze/include/glaze/core/write_chars.hpp:11:
external/_main~conan_extension~glaze/include/glaze/util/dtoa.hpp:1043:28: error: assigning to 'std::byte' from incompatible type 'char'
               buffer[1] = '.';

from glaze.

stephenberry avatar stephenberry commented on September 25, 2024

The issue is actually not with ndjson, but with writing to std::vector<std::byte>. I've fixed this in #1089 and will merge soon.

I still have to fix binary support for glz::json_t

from glaze.

meftunca avatar meftunca commented on September 25, 2024

I see. Do you have an estimate for the completion date for Binary?

from glaze.

stephenberry avatar stephenberry commented on September 25, 2024

Binary support should get merged in the next hour. Active merge request: #1090

from glaze.

stephenberry avatar stephenberry commented on September 25, 2024

Binary support for json_t has been merged

from glaze.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.