SFINAE guard on jwt_object's universal reference constructor

This allows the move constructor to be preferred in some cases.
This commit is contained in:
Matt Frantz 2018-11-01 13:28:49 -07:00
parent 043c8429d4
commit 1b105f4772
2 changed files with 4 additions and 2 deletions

View file

@ -290,7 +290,9 @@ jwt_signature::get_verify_algorithm_impl(const jwt_header& hdr) const noexcept
//
template <typename First, typename... Rest>
jwt_object::jwt_object(First&& first, Rest&&... rest)
jwt_object::jwt_object(
std::enable_if_t<detail::meta::is_parameter_concept<First>::value, First>&& first,
Rest&&... rest)
{
static_assert (detail::meta::is_parameter_concept<First>::value &&
detail::meta::are_all_params<Rest...>::value,

View file

@ -889,7 +889,7 @@ public: // 'tors
* to populate header. Not much useful unless JWE is supported.
*/
template <typename First, typename... Rest>
jwt_object(First&& first, Rest&&... rest);
jwt_object(std::enable_if_t<detail::meta::is_parameter_concept<First>::value, First>&& first, Rest&&... rest);
public: // Exposed static APIs
/**