You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the issue you have?
The compilation error:
/include/nlohmann/detail/iterators/iter_impl.hpp:262:48: error: invalid conversion from 'const nlohmann::basic_json<ordered_map>*' to 'nlohma
nn::detail::iter_impl<nlohmann::basic_json<ordered_map> >::pointer' {aka 'nlohmann::basic_json<ordered_map>*'} [-fpermissive]
return &(m_it.object_iterator->second);
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
ordered_map is defined as following:
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>>>;
namespace json
{
using namespace nlohmann;
using json_ord = basic_json<ordered_map>;
}
inline json::json_ord operator "" _json_ord(const char* s, std::size_t n)
{
return json::json_ord::parse(s, s + n);
}
inline json::json_ord::json_pointer operator "" _json_ord_pointer(const char* s, std::size_t n)
{
return json::json_ord::json_pointer(std::string(s, n));
}
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Just use the previous definitions to create a json object that uses ordered_map.
What is the expected behavior?
No compilation errors or warnings.
And what is the actual behavior instead?
A compilation error or warning if -fpermissive option provided.
Which compiler and operating system are you using? Is it a supported compiler?
GCC/MinGW 8.2.1
Did you use a released version of the library or the version from the develop branch?
The MinGW distribution package was downloaded from https://gcc-mcf.lhmouse.com/
In #546, the following hint for integration was made: #546 (comment). I cannot compile your code snippet either - it seems that the interfaces of std::map and tsl::ordered_map and the library fails to compile because of this.
The compilation error:
ordered_map is defined as following:
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Just use the previous definitions to create a json object that uses ordered_map.
What is the expected behavior?
No compilation errors or warnings.
And what is the actual behavior instead?
A compilation error or warning if -fpermissive option provided.
Which compiler and operating system are you using? Is it a supported compiler?
GCC/MinGW 8.2.1
Did you use a released version of the library or the version from the
develop
branch?The MinGW distribution package was downloaded from https://gcc-mcf.lhmouse.com/
If you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: