Skip to content

Commit

Permalink
using a fwd decl
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed May 26, 2020
1 parent 9afe25a commit 88c4886
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,26 @@ namespace jwt {
class integer_type = int64_t,
class number_type = double,
typename traits = details::picojson_traits>
class basic_claim;

/**
* Convenience wrapper for JSON claim
*/
using claim = basic_claim<>;

#define JWT_BASIC_CLAIM_TPL_DECLARATION_TYPES \
typename value_type, class object_type, class array_type, \
class string_type, class boolean_type, class integer_type, \
class number_type, typename traits \

#define JWT_BASIC_CLAIM_TPL_DECLARATION \
template<JWT_BASIC_CLAIM_TPL_DECLARATION_TYPES>

#define JWT_BASIC_CLAIM_TPL \
value_type, object_type, array_type, string_type, \
boolean_type, integer_type, number_type, traits

JWT_BASIC_CLAIM_TPL_DECLARATION
class basic_claim {
// TODO: FixMe
static_assert(std::is_same<string_type, std::string>::value, "current this only supports an `std::string` due to the sining and base64 encoding that is required by JWT.");
Expand Down Expand Up @@ -1073,23 +1093,6 @@ namespace jwt {
}
};

/**
* Convenience wrapper for JSON claim
*/
using claim = basic_claim<>;

#define JWT_BASIC_CLAIM_TPL_DECLARATION_TYPES \
typename value_type, class object_type, class array_type, \
class string_type, class boolean_type, class integer_type, \
class number_type, typename traits \

#define JWT_BASIC_CLAIM_TPL_DECLARATION \
template<JWT_BASIC_CLAIM_TPL_DECLARATION_TYPES>

#define JWT_BASIC_CLAIM_TPL \
value_type, object_type, array_type, string_type, \
boolean_type, integer_type, number_type, traits

/**
* Base class that represents a token payload.
* Contains Convenience accessors for common claims.
Expand Down

0 comments on commit 88c4886

Please sign in to comment.