Skip to content

Commit

Permalink
fully qualify object_t and array_t aliases with comparator and alloca…
Browse files Browse the repository at this point in the history
…tor types. #ifndef _MSC_VER
  • Loading branch information
RossBencina committed May 24, 2015
1 parent 03b0d1d commit 94de11e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,24 @@ class basic_json
///////////////////////////
// JSON value data types //
///////////////////////////

#ifndef _MSC_VER
/// a type for an object
using object_t = ObjectType<StringType, basic_json>;
/// a type for an array
using array_t = ArrayType<basic_json>;
#else
// MSVC2013 doesn't seem to be able to resolve the varargs template parameters
// json.hpp(152): error C2976: 'std::map' : too few template arguments
// : see declaration of 'std::map'
// json.hpp(154) : error C2976 : 'std::vector' : too few template arguments
// : see declaration of 'std::vector'
// The following fully qualified names work:

/// a type for an object
using object_t = ObjectType<StringType, basic_json, std::less<StringType>, AllocatorType<std::pair<const StringType,basic_json> > >;
/// a type for an array
using array_t = ArrayType<basic_json, AllocatorType<basic_json> >;
#endif
/// a type for a string
using string_t = StringType;
/// a type for a boolean
Expand Down

0 comments on commit 94de11e

Please sign in to comment.