PavelKisliak / BitSerializer

Multi-format serialization library (JSON, XML, YAML, CSV, MsgPack)
Other
8 stars 2 forks source link

Static assertion failure #5

Open redrabbit007 opened 1 week ago

redrabbit007 commented 1 week ago

I'm trying to use the library to do msgpack, I'm using Conan. I'm getting a compiler error that a static assertion is failing. Here's the error message:

In file included from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/serialization_detail/errors_handling.h:10,
                 from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/serialization_detail/serialization_context.h:8,
                 from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/serialization_detail/archive_base.h:7,
                 from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/serialization_detail/object_traits.h:9,
                 from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/serialization_detail/serialization_base_types.h:8,
                 from /home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/bit_serializer.h:8,
                 from /home/user/project/processing_file.hpp:27,
                 from /home/user/project/processor.hpp:16,
                 from /home/user/project/processor.cpp:3:
/home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/convert.h: In instantiation of ‘TOut BitSerializer::Convert::To(TIn&&) [with TOut = std::__cxx11::basic_string<char>; TIn = const long unsigned int&]’:
/home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/convert.h:72:25:   required from ‘std::string BitSerializer::Convert::ToString(TIn&&) [with TIn = const long unsigned int&; std::string = std::__cxx11::basic_string<char>]’
/home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/msgpack_archive.h:514:28:   required from ‘std::string BitSerializer::MsgPack::Detail::CMsgPackReadBinaryScope<TReader>::GetPath() const [with TReader = BitSerializer::MsgPack::Detail::IMsgPackReader; std::string = std::__cxx11::basic_string<char>]’
/home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/msgpack_archive.h:510:28:   required from here
/home/user/.conan/data/bitserializer/0.70/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/bitserializer/convert.h:42:24: error: static
   assertion failed: BitSerializer::Convert. Converting these types is not supported.
   42 |   static_assert(isSame || isConvertible, "BitSerializer::Convert. Converting these types is not su
pported.");
      |                 ~~~~~~~^~~~~~~~~~~~~~~~
PavelKisliak commented 1 week ago

Looks like that BitSerializer::Convert::Detail::is_convert_supported_v does not work properly on your configuration.

It's strange that you have such issue especially with Conan, because it includes simple test application which performs simple serialization for all type of archives.

Please make sure that you haven't direct includes from BitSerializer's folders with details (conversion_detail, serialization_detail), sometime order is important.

I need more information for I can reproduce the issue, at least platform, compiler, C++ standard.