-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error using GCC 8 RC #9
Comments
Effectively, the problem comes from the type in the allocator . The JSON library has the following line (where using object_t = ObjectType<StringType,
basic_json,
object_comparator_t,
AllocatorType<std::pair<const StringType, basic_json>>>; Due to its nature (open-addressing hash map), the One way to overcome this would be to ignore the allocator (replace template<class Key, class T, class Ignore1, class Ignore2, class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<std::pair<Key, T>>>
using ordered_map = tsl::ordered_map<Key, T, Hash, KeyEqual, Allocator>; I have to check if there is a better way, but this one should works. |
Thanks! This works for me! 👍 |
I updated my reply on the nlohmann/json issue. It's better to prefer this way so that when a specific allocator is used in template<class Key, class T, class Ignore, class Allocator,
class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>>
using ordered_map = tsl::ordered_map<Key, T, Hash, KeyEqual,
typename std::allocator_traits<Allocator>::template
rebind_alloc<std::pair<Key, T>>>; |
WOW! Even better! Thanks a lot! 👍 |
Using MinGW GCC 8 RC from here.
There is the compilation error when using the following code:
This is the following error:
The text was updated successfully, but these errors were encountered: