-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Using tsl::ordered_map #546
Comments
Related to #485. |
I failed to compile an example myself, but did not find the time to dig into it. |
It seems Also One way to overcome these issues could be to use something like: template<class Key, class T, class Ignore, class Allocator,
class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>,
class AllocatorPair = typename std::allocator_traits<Allocator>::template rebind_alloc<std::pair<Key, T>>,
class ValueTypeContainer = std::vector<std::pair<Key, T>, AllocatorPair>>
using ordered_map = tsl::ordered_map<Key, T, Hash, KeyEqual, AllocatorPair, ValueTypeContainer>;
using json = nlohmann::basic_json<ordered_map>; But it's probably not the best solution. The best solution would be to be able to use any associative container no matter where the position of the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
While trying to get ordered #include <nlohmann/json.hpp>
#include <tsl/ordered_map.h>
// for convenience
using json = nlohmann::basic_json<tsl::ordered_map>; but I am getting the same error as the OP (@arvidsson).
It seems that neither Or which compiler supports them as I assume some must as the README recommends both? |
To be able to use basic_json with tsl::ordered_map, I wrote this patch ilelann@f106d6b |
Hi!
I'm using Visual Studio C++ 2017 and I get the following error when I try to use tsl::ordered_map with basic_json:
'std::pair<Key,T>::second' uses undefined class 'nlohmann::basic_jsontsl::ordered_map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer'
The text was updated successfully, but these errors were encountered: