undid the fix for #136
This commit is contained in:
parent
cd04a7d3e9
commit
1df5d726d9
3 changed files with 6 additions and 41 deletions
|
@ -42,12 +42,15 @@ to the files you want to use JSON objects. That's it. Do not forget to set the n
|
||||||
|
|
||||||
Though it's 2015 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:
|
Though it's 2015 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:
|
||||||
|
|
||||||
- GCC 4.9 - 5.2 (and possible later)
|
- GCC 4.9 - 5.2 (and possibly later)
|
||||||
- Clang 3.4 - 3.7 (and possible later)
|
- Clang 3.4 - 3.7 (and possibly later)
|
||||||
- Microsoft Visual C++ 14.0 RC (and possible later)
|
- Microsoft Visual C++ 14.0 RC (and possibly later)
|
||||||
|
|
||||||
I would be happy to learn about other compilers/versions.
|
I would be happy to learn about other compilers/versions.
|
||||||
|
|
||||||
|
For GCC running on MinGW or Android SDK, the error `'to_string' is not a member of 'std'` (or similarly, for `strtod`) may occur. Note this is not an issue with the code, but rather with the compiler itself. Please refer to [this site](http://tehsausage.com/mingw-to-string) and [this discussion](https://github.com/nlohmann/json/issues/136) for information on how to fix this bug.
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
Here are some examples to give you an idea how to use the class.
|
Here are some examples to give you an idea how to use the class.
|
||||||
|
|
19
src/json.hpp
19
src/json.hpp
|
@ -70,25 +70,6 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation.
|
||||||
using ssize_t = SSIZE_T;
|
using ssize_t = SSIZE_T;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// workaround for Android NDK (see https://github.com/nlohmann/json/issues/136)
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
template <typename T>
|
|
||||||
std::string to_string(T v)
|
|
||||||
{
|
|
||||||
std::ostringstream ss;
|
|
||||||
ss << v;
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline long double strtold(const char* str, char** str_end)
|
|
||||||
{
|
|
||||||
return strtod(str, str_end);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief namespace for Niels Lohmann
|
@brief namespace for Niels Lohmann
|
||||||
@see https://github.com/nlohmann
|
@see https://github.com/nlohmann
|
||||||
|
|
|
@ -70,25 +70,6 @@ Class @ref nlohmann::basic_json is a good entry point for the documentation.
|
||||||
using ssize_t = SSIZE_T;
|
using ssize_t = SSIZE_T;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// workaround for Android NDK (see https://github.com/nlohmann/json/issues/136)
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
namespace std
|
|
||||||
{
|
|
||||||
template <typename T>
|
|
||||||
std::string to_string(T v)
|
|
||||||
{
|
|
||||||
std::ostringstream ss;
|
|
||||||
ss << v;
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline long double strtold(const char* str, char** str_end)
|
|
||||||
{
|
|
||||||
return strtod(str, str_end);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief namespace for Niels Lohmann
|
@brief namespace for Niels Lohmann
|
||||||
@see https://github.com/nlohmann
|
@see https://github.com/nlohmann
|
||||||
|
|
Loading…
Reference in a new issue