Comments (9)
I just added a test for this issue.
But it compiles and generates no errors for me:
https://github.com/Loki-Astari/ThorsSerializer/blob/master/src/Serialize/test/Issue72Test.cpp
If you can modify this file to generate the same errors as you get I will accept the pull request and I can go from there.
Or if you want to reply here with more information so I can reproduce the error.
from thorsserializer.
Thanks. Well, again, this is way above my cpp skills.
It looks like the typedef for unsigned int
and signed int
is the same size as long unsigned int
and long signed int
with Newlib for arm-gcc-eabi, so "auto" can't deduce for the correct type for std::pair
I found this somewhat similar issue for another project: https://github.com/harfbuzz/harfbuzz/issues/451
This would explain why it doesn't compile for me, and it does for your compiler.
Fixing it is another matter. I tried to remove all of the templates for int
and unsigned int
but that didn't help
from thorsserializer.
Try this change on line 580 of Traits.h
let me know if it fixes the issue:
auto sizeData = ....
///change to
std::initializer_list<std::pair<std::size_t, std::size_t>> sizeData =
from thorsserializer.
If that does not work try: 580 of Traits.h
std::make_pair(0UL, 0UL)
/// Change to
std::make_pair(std::size_t{0}, std::size_t{0})
from thorsserializer.
One of those two or both should resolve the issue.
For initializer_list<>
to work all the elements have to be the same type.
So the function call is returning: addSizeEachMemberItem()
is returning std::pair<std:size_t, std::size_t>
and make_pair()
is returning std::pair<unsigned long, unsigned long>
on most systems these would match looks like maybe your system is using unsigned int
for std::size_t
which causes the issue. So either we make the list a specific type so the compiler does not need to deduce the type or we are more explicit on the type of the initial pair in the list.
from thorsserializer.
I see quite a few changes since my last pull!
Sine your last pull (which must have been more than 6 months ago) I have added support for BSON (this is a Binary Json format that is used by Mongo DB).
The advantages of BSON is that fields have a known size or are prefixed by their size (so easy to skip them).
The disadvantages of BSON is that it is not very human-readable and arrays are implemented in a clunky fashion. Additionally, if you store a lot of small integers then BSON is bulkier as it always uses four bytes for an integer and is scattered with size objects that take up space (though JSON is scattered with lots of white space so win/loose).
from thorsserializer.
Try this change on line
580 of Traits.h
let me know if it fixes the issue:auto sizeData = .... ///change to std::initializer_list<std::pair<std::size_t, std::size_t>> sizeData =
I tested this change and it addresses the issue. Thank You!
from thorsserializer.
I will update the code and push.
from thorsserializer.
Pushed an update.
Closing issue.
from thorsserializer.
Related Issues (20)
- How to combine templates and polymorphism? HOT 7
- Maximum number of levels/depth? HOT 5
- No compile enum with 8 and more element HOT 6
- Deserializing to existing object with vectors/pointers? HOT 8
- Std:array not working on header only version HOT 6
- Make under Homebrew results in template error HOT 1
- Make Trait does not work for types with static members with non-standard types HOT 1
- Compilation issue with VisualStudio 2019 on Windows HOT 4
- my compile problem of example1 HOT 1
- Redefine traits at runtime HOT 6
- [Linuxbrew] Trying to prepare v2.2.0 bottle but hitting compilation issues (tried GCC-11 and LLVM) HOT 10
- Tags with header only HOT 7
- Linker error on basic example, I am missing something? HOT 4
- Linker Error? HOT 5
- Invalid enum values causes undefined behavior HOT 1
- missing include file magic_enum.hpp HOT 3
- Linker fails with header-only build HOT 11
- Why there is no CMAKE support? HOT 5
- error compiling with std::shared_ptr<const Type> HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thorsserializer.