File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,12 @@ class JSON_API StaticString {
85
85
const char * str_;
86
86
};
87
87
88
- // Some helper traits for Json::Value
88
+ // Some Json::Value helpers in lieu of C++11 <type_traits>.
89
89
namespace Detail {
90
90
91
91
template <typename T>
92
92
struct IsIntegral {
93
- enum { value = std::numeric_limits<T>::is_specialized &&
94
- std::numeric_limits<T>::is_integer };
93
+ enum { value = std::numeric_limits<T>::is_integer };
95
94
};
96
95
97
96
template <typename T>
@@ -236,6 +235,21 @@ Json::Value obj_value(Json::objectValue); // {}
236
235
*/
237
236
Value (ValueType type = nullValue);
238
237
238
+ /* * \brief Accept any arithmetic 'T'.
239
+ *
240
+ * Selected by substitution failure (sfinae) on dummy argument.
241
+ * Arithmetic means built-in integral or floating point type.
242
+ * This is currently determined with std::numeric_traits.
243
+ * Example:
244
+ * \code
245
+ * Json::Value v[] = {
246
+ * Json::Value(my_vector.size()),
247
+ * Json::Value(array_last - array_first),
248
+ * Json::Value('x'),
249
+ * Json::Value(3.14)
250
+ * };
251
+ * \endcode
252
+ */
239
253
template <typename T>
240
254
Value (T value, typename Detail::EnableIfArithmetic<T>::type = 0 )
241
255
: allocated_(false ),
You can’t perform that action at this time.
0 commit comments