-
Notifications
You must be signed in to change notification settings - Fork 812
Description
So I have been using Cereal for roughly a year now for a personal project.
And recently I carelessly swapped out a double
for the new std::float32_t
added in C++23 https://en.cppreference.com/w/cpp/header/stdfloat.html.
This caused a compiler error because the these new float types are not yet supported by the cereal library:
In file included from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/../archive/archive.hpp:12,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/node_interface.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/list.hpp:10,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include_nodes.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/clir/clir_builder/clir_builder.cpp:4:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp: In instantiation of ‘void cereal::JSONInputArchive::loadValue(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value, (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), ((sizeof (T) >= sizeof (long double)) || (sizeof (T) >= sizeof (long long int)))>::type <anonymous> = (cereal::traits::detail::sfinae)0]’:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:984:17: required from ‘void cereal::load(JSONInputArchive&, T&) [with T = _Float64; typename traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value>::type <anonymous> = (cereal::traits::detail::sfinae)0]’
984 | ar.loadValue( t );
| ~~~~~~~~~~~~^~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::processImpl(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<cereal::traits::has_non_member_load<T, ArchiveType>::value, (! cereal::traits::has_invalid_input_versioning<T, ArchiveType>::value), (cereal::traits::is_input_serializable<T, ArchiveType>::value && (cereal::traits::is_specialized_non_member_load<T, ArchiveType>::value || (! cereal::traits::is_specialized<T, ArchiveType>::value)))>::type <anonymous> = (cereal::traits::detail::sfinae)0; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
941 | CEREAL_LOAD_FUNCTION_NAME(*self, t);
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:853:26: required from ‘void cereal::InputArchive<ArchiveType, Flags>::process(T&&) [with T = _Float64&; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
853 | self->processImpl( head );
| ~~~~~~~~~~~~~~~~~^~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:730:16: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {_Float64&}; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
730 | process( std::forward<Types>( args )... );
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:956:7: required from ‘void cereal::load(JSONInputArchive&, NameValuePair<T>&) [with T = _Float64&]’
956 | ar( t.value );
| ~~^~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: [ skipping 24 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:769:39: required from ‘static void cereal::detail::polymorphic_serialization_support<Archive, T>::instantiate() [with Archive = cereal::JSONInputArchive; T = ast::node::rvalue::Literal<_Float64>]’
769 | create_bindings<Archive,T>::load( std::integral_constant<bool,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770 | std::is_base_of<detail::InputArchiveBase, Archive>::value &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
771 | traits::is_input_serializable<T, Archive>::value>{} );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:757:47: required from ‘struct cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, ast::node::rvalue::Literal<_Float64> >’
757 | typedef instantiate_function<instantiate> unused;
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:1018:1: required by substitution of ‘template<class T, class BindingTag> typename cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, T>::type cereal::detail::instantiate_polymorphic_binding(T*, cereal::JSONInputArchive*, BindingTag, adl_tag) [with T = ast::node::rvalue::Literal<_Float64>; BindingTag = cereal::detail::polymorphic_binding_tag]’
1018 | CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive)
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:785:40: required from ‘void cereal::detail::bind_to_archives<T, Tag>::bind(std::false_type) const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag; std::false_type = std::false_type]’
785 | instantiate_polymorphic_binding(static_cast<T*>(nullptr), 0, Tag{}, adl_tag{});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:799:13: required from ‘const cereal::detail::bind_to_archives<T, Tag>& cereal::detail::bind_to_archives<T, Tag>::bind() const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag]’
799 | bind( std::is_abstract<T>() );
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/src/crow/ast/node/rvalue/literal.hpp:41:1: required from here
71 | CEREAL_REGISTER_TYPE_WITH_NAME(t_namespace::t_typename, #t_typename) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:722:23: error: no matching function for call to ‘stringToNumber(std::string&, _Float64&)’
722 | stringToNumber( encoded, val );
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long int&)’ (near match)
704 | void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: error: cannot bind non-const lvalue reference of type ‘long long int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long unsigned int&)’ (near match)
706 | void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: error: cannot bind non-const lvalue reference of type ‘long long unsigned int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long double&)’ (near match)
708 | void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: error: cannot bind non-const lvalue reference of type ‘long double&’ to a value of type ‘_Float64’
gmake[2]: *** [CMakeFiles/crowlib.dir/build.make:1199: CMakeFiles/crowlib.dir/src/crow/clir/clir_builder/clir_builder.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/../archive/archive.hpp:12,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/node_interface.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/list.hpp:10,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include_nodes.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/codegen/cpp_backend/prototype_generator.cpp:7:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp: In instantiation of ‘void cereal::JSONInputArchive::loadValue(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value, (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), ((sizeof (T) >= sizeof (long double)) || (sizeof (T) >= sizeof (long long int)))>::type <anonymous> = (cereal::traits::detail::sfinae)0]’:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:984:17: required from ‘void cereal::load(JSONInputArchive&, T&) [with T = _Float64; typename traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value>::type <anonymous> = (cereal::traits::detail::sfinae)0]’
984 | ar.loadValue( t );
| ~~~~~~~~~~~~^~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::processImpl(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<cereal::traits::has_non_member_load<T, ArchiveType>::value, (! cereal::traits::has_invalid_input_versioning<T, ArchiveType>::value), (cereal::traits::is_input_serializable<T, ArchiveType>::value && (cereal::traits::is_specialized_non_member_load<T, ArchiveType>::value || (! cereal::traits::is_specialized<T, ArchiveType>::value)))>::type <anonymous> = (cereal::traits::detail::sfinae)0; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
941 | CEREAL_LOAD_FUNCTION_NAME(*self, t);
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:853:26: required from ‘void cereal::InputArchive<ArchiveType, Flags>::process(T&&) [with T = _Float64&; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
853 | self->processImpl( head );
| ~~~~~~~~~~~~~~~~~^~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:730:16: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {_Float64&}; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
730 | process( std::forward<Types>( args )... );
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:956:7: required from ‘void cereal::load(JSONInputArchive&, NameValuePair<T>&) [with T = _Float64&]’
956 | ar( t.value );
| ~~^~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: [ skipping 24 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:769:39: required from ‘static void cereal::detail::polymorphic_serialization_support<Archive, T>::instantiate() [with Archive = cereal::JSONInputArchive; T = ast::node::rvalue::Literal<_Float64>]’
769 | create_bindings<Archive,T>::load( std::integral_constant<bool,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770 | std::is_base_of<detail::InputArchiveBase, Archive>::value &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
771 | traits::is_input_serializable<T, Archive>::value>{} );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:757:47: required from ‘struct cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, ast::node::rvalue::Literal<_Float64> >’
757 | typedef instantiate_function<instantiate> unused;
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:1018:1: required by substitution of ‘template<class T, class BindingTag> typename cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, T>::type cereal::detail::instantiate_polymorphic_binding(T*, cereal::JSONInputArchive*, BindingTag, adl_tag) [with T = ast::node::rvalue::Literal<_Float64>; BindingTag = cereal::detail::polymorphic_binding_tag]’
1018 | CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive)
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:785:40: required from ‘void cereal::detail::bind_to_archives<T, Tag>::bind(std::false_type) const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag; std::false_type = std::false_type]’
785 | instantiate_polymorphic_binding(static_cast<T*>(nullptr), 0, Tag{}, adl_tag{});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:799:13: required from ‘const cereal::detail::bind_to_archives<T, Tag>& cereal::detail::bind_to_archives<T, Tag>::bind() const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag]’
799 | bind( std::is_abstract<T>() );
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/src/crow/ast/node/rvalue/literal.hpp:41:1: required from here
71 | CEREAL_REGISTER_TYPE_WITH_NAME(t_namespace::t_typename, #t_typename) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:722:23: error: no matching function for call to ‘stringToNumber(std::string&, _Float64&)’
722 | stringToNumber( encoded, val );
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long int&)’ (near match)
704 | void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: error: cannot bind non-const lvalue reference of type ‘long long int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long unsigned int&)’ (near match)
706 | void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: error: cannot bind non-const lvalue reference of type ‘long long unsigned int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long double&)’ (near match)
708 | void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: error: cannot bind non-const lvalue reference of type ‘long double&’ to a value of type ‘_Float64’
In file included from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/../archive/archive.hpp:12,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/node_interface.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/list.hpp:10,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include_nodes.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/codegen/cpp_backend/cpp_backend.cpp:10:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp: In instantiation of ‘void cereal::JSONInputArchive::loadValue(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value, (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), ((sizeof (T) >= sizeof (long double)) || (sizeof (T) >= sizeof (long long int)))>::type <anonymous> = (cereal::traits::detail::sfinae)0]’:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:984:17: required from ‘void cereal::load(JSONInputArchive&, T&) [with T = _Float64; typename traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value>::type <anonymous> = (cereal::traits::detail::sfinae)0]’
984 | ar.loadValue( t );
| ~~~~~~~~~~~~^~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::processImpl(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<cereal::traits::has_non_member_load<T, ArchiveType>::value, (! cereal::traits::has_invalid_input_versioning<T, ArchiveType>::value), (cereal::traits::is_input_serializable<T, ArchiveType>::value && (cereal::traits::is_specialized_non_member_load<T, ArchiveType>::value || (! cereal::traits::is_specialized<T, ArchiveType>::value)))>::type <anonymous> = (cereal::traits::detail::sfinae)0; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
941 | CEREAL_LOAD_FUNCTION_NAME(*self, t);
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:853:26: required from ‘void cereal::InputArchive<ArchiveType, Flags>::process(T&&) [with T = _Float64&; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
853 | self->processImpl( head );
| ~~~~~~~~~~~~~~~~~^~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:730:16: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {_Float64&}; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
730 | process( std::forward<Types>( args )... );
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:956:7: required from ‘void cereal::load(JSONInputArchive&, NameValuePair<T>&) [with T = _Float64&]’
956 | ar( t.value );
| ~~^~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: [ skipping 24 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:769:39: required from ‘static void cereal::detail::polymorphic_serialization_support<Archive, T>::instantiate() [with Archive = cereal::JSONInputArchive; T = ast::node::rvalue::Literal<_Float64>]’
769 | create_bindings<Archive,T>::load( std::integral_constant<bool,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770 | std::is_base_of<detail::InputArchiveBase, Archive>::value &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
771 | traits::is_input_serializable<T, Archive>::value>{} );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:757:47: required from ‘struct cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, ast::node::rvalue::Literal<_Float64> >’
757 | typedef instantiate_function<instantiate> unused;
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:1018:1: required by substitution of ‘template<class T, class BindingTag> typename cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, T>::type cereal::detail::instantiate_polymorphic_binding(T*, cereal::JSONInputArchive*, BindingTag, adl_tag) [with T = ast::node::rvalue::Literal<_Float64>; BindingTag = cereal::detail::polymorphic_binding_tag]’
1018 | CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive)
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:785:40: required from ‘void cereal::detail::bind_to_archives<T, Tag>::bind(std::false_type) const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag; std::false_type = std::false_type]’
785 | instantiate_polymorphic_binding(static_cast<T*>(nullptr), 0, Tag{}, adl_tag{});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:799:13: required from ‘const cereal::detail::bind_to_archives<T, Tag>& cereal::detail::bind_to_archives<T, Tag>::bind() const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag]’
799 | bind( std::is_abstract<T>() );
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/src/crow/ast/node/rvalue/literal.hpp:41:1: required from here
71 | CEREAL_REGISTER_TYPE_WITH_NAME(t_namespace::t_typename, #t_typename) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:722:23: error: no matching function for call to ‘stringToNumber(std::string&, _Float64&)’
722 | stringToNumber( encoded, val );
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long int&)’ (near match)
704 | void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: error: cannot bind non-const lvalue reference of type ‘long long int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long unsigned int&)’ (near match)
706 | void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: error: cannot bind non-const lvalue reference of type ‘long long unsigned int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long double&)’ (near match)
708 | void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: error: cannot bind non-const lvalue reference of type ‘long double&’ to a value of type ‘_Float64’
In file included from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/../archive/archive.hpp:12,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/node_interface.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/list.hpp:10,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/ast/node/include_nodes.hpp:5,
from /home/hackerman/.bmarks/crowlang/src/crow/codegen/cpp_backend/type_variant2cpp_type.cpp:8:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp: In instantiation of ‘void cereal::JSONInputArchive::loadValue(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value, (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), (! std::is_same<T, long int>::value), (! std::is_same<T, long unsigned int>::value), ((sizeof (T) >= sizeof (long double)) || (sizeof (T) >= sizeof (long long int)))>::type <anonymous> = (cereal::traits::detail::sfinae)0]’:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:984:17: required from ‘void cereal::load(JSONInputArchive&, T&) [with T = _Float64; typename traits::detail::EnableIfHelper<std::is_arithmetic<_Tp>::value>::type <anonymous> = (cereal::traits::detail::sfinae)0]’
984 | ar.loadValue( t );
| ~~~~~~~~~~~~^~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::processImpl(T&) [with T = _Float64; typename cereal::traits::detail::EnableIfHelper<cereal::traits::has_non_member_load<T, ArchiveType>::value, (! cereal::traits::has_invalid_input_versioning<T, ArchiveType>::value), (cereal::traits::is_input_serializable<T, ArchiveType>::value && (cereal::traits::is_specialized_non_member_load<T, ArchiveType>::value || (! cereal::traits::is_specialized<T, ArchiveType>::value)))>::type <anonymous> = (cereal::traits::detail::sfinae)0; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
941 | CEREAL_LOAD_FUNCTION_NAME(*self, t);
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:853:26: required from ‘void cereal::InputArchive<ArchiveType, Flags>::process(T&&) [with T = _Float64&; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
853 | self->processImpl( head );
| ~~~~~~~~~~~~~~~~~^~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:730:16: required from ‘ArchiveType& cereal::InputArchive<ArchiveType, Flags>::operator()(Types&& ...) [with Types = {_Float64&}; ArchiveType = cereal::JSONInputArchive; unsigned int Flags = 0]’
730 | process( std::forward<Types>( args )... );
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:956:7: required from ‘void cereal::load(JSONInputArchive&, NameValuePair<T>&) [with T = _Float64&]’
956 | ar( t.value );
| ~~^~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/cereal.hpp:941:34: [ skipping 24 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:769:39: required from ‘static void cereal::detail::polymorphic_serialization_support<Archive, T>::instantiate() [with Archive = cereal::JSONInputArchive; T = ast::node::rvalue::Literal<_Float64>]’
769 | create_bindings<Archive,T>::load( std::integral_constant<bool,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770 | std::is_base_of<detail::InputArchiveBase, Archive>::value &&
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
771 | traits::is_input_serializable<T, Archive>::value>{} );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:757:47: required from ‘struct cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, ast::node::rvalue::Literal<_Float64> >’
757 | typedef instantiate_function<instantiate> unused;
| ^
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:1018:1: required by substitution of ‘template<class T, class BindingTag> typename cereal::detail::polymorphic_serialization_support<cereal::JSONInputArchive, T>::type cereal::detail::instantiate_polymorphic_binding(T*, cereal::JSONInputArchive*, BindingTag, adl_tag) [with T = ast::node::rvalue::Literal<_Float64>; BindingTag = cereal::detail::polymorphic_binding_tag]’
1018 | CEREAL_REGISTER_ARCHIVE(cereal::JSONInputArchive)
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:785:40: required from ‘void cereal::detail::bind_to_archives<T, Tag>::bind(std::false_type) const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag; std::false_type = std::false_type]’
785 | instantiate_polymorphic_binding(static_cast<T*>(nullptr), 0, Tag{}, adl_tag{});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/details/polymorphic_impl.hpp:799:13: required from ‘const cereal::detail::bind_to_archives<T, Tag>& cereal::detail::bind_to_archives<T, Tag>::bind() const [with T = ast::node::rvalue::Literal<_Float64>; Tag = cereal::detail::polymorphic_binding_tag]’
799 | bind( std::is_abstract<T>() );
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/src/crow/ast/node/rvalue/literal.hpp:41:1: required from here
71 | CEREAL_REGISTER_TYPE_WITH_NAME(t_namespace::t_typename, #t_typename) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:722:23: error: no matching function for call to ‘stringToNumber(std::string&, _Float64&)’
722 | stringToNumber( encoded, val );
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long int&)’ (near match)
704 | void stringToNumber( std::string const & str, long long & val ) { val = std::stoll( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:704:12: error: cannot bind non-const lvalue reference of type ‘long long int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long long unsigned int&)’ (near match)
706 | void stringToNumber( std::string const & str, unsigned long long & val ) { val = std::stoull( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:706:12: error: cannot bind non-const lvalue reference of type ‘long long unsigned int&’ to a value of type ‘_Float64’
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: candidate: ‘void cereal::JSONInputArchive::stringToNumber(const std::string&, long double&)’ (near match)
708 | void stringToNumber( std::string const & str, long double & val ) { val = std::stold( str ); }
| ^~~~~~~~~~~~~~
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: note: conversion of argument 2 would be ill-formed:
/home/hackerman/.bmarks/crowlang/debug-build/_deps/cereal-src/include/cereal/archives/json.hpp:708:12: error: cannot bind non-const lvalue reference of type ‘long double&’ to a value of type ‘_Float64’
gmake[2]: *** [CMakeFiles/crowlib.dir/build.make:1255: CMakeFiles/crowlib.dir/src/crow/codegen/cpp_backend/prototype_generator.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/crowlib.dir/build.make:1241: CMakeFiles/crowlib.dir/src/crow/codegen/cpp_backend/cpp_backend.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/crowlib.dir/build.make:1269: CMakeFiles/crowlib.dir/src/crow/codegen/cpp_backend/type_variant2cpp_type.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1182: CMakeFiles/crowlib.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
Since other modern C++ (C++17) types are supported like (https://github.com/USCiLab/cereal/tree/a56bad8bbb770ee266e930c95d37fff2a5be7fea/include/cereal/types):
- std::variant
- std::optional
I think it would be beneficial to have these new float types be supported by the library.
As these are new native types so its best to have the serialization for these not be custom.
But instead be a part of the cereal library.
As in the future, these fixed width floats will be used a ton in other projects.
I am open to implementing this myself, if adding this to the library is desirable/confirmed/approved.