compile error with master
darrenjs opened this issue · comments
Hi ... trying to build lastest version of master, but getting compile error below. I am trying to build the first example found on the main page.
However, I don't get this error with release v1.1.0
/home/build/opt/gcc-8.2.0/bin/g++ -MMD -MP -Wall -O0 -g3 -ggdb -std=c++17 -I/home/build/opt/cpp-jwt/cpp-jwt/include -c example.cc
example.cc: In function ‘int main()’:
example.cc:9:86: error: no matching function for call to ‘jwt::jwt_object::jwt_object(<brace-enclosed initializer list>)’
jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
^
In file included from example.cc:2:
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:892:3: note: candidate: ‘template<class First, class ... Rest> jwt::jwt_object::jwt_object(std::enable_if_t<jwt::detail::meta::is_parameter_concept<First>::value, First>&&, Rest&& ...)’
jwt_object(std::enable_if_t<detail::meta::is_parameter_concept<First>::value, First>&& first, Rest&&... rest);
^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:892:3: note: template argument deduction/substitution failed:
example.cc:9:86: note: couldn't deduce template parameter ‘First’
jwt::jwt_object obj{algorithm("HS256"), payload({{"some", "payload"}}), secret(key)};
^
In file included from example.cc:2:
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:870:3: note: candidate: ‘jwt::jwt_object::jwt_object()’
jwt_object() = default;
^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:870:3: note: candidate expects 0 arguments, 3 provided
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate: ‘jwt::jwt_object::jwt_object(const jwt::jwt_object&)’
class jwt_object
^~~~~~~~~~
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate expects 1 argument, 3 provided
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate: ‘jwt::jwt_object::jwt_object(jwt::jwt_object&&)’
/home/build/opt/cpp-jwt/cpp-jwt/include/jwt/jwt.hpp:864:7: note: candidate expects 1 argument, 3 provided
makefile:23: recipe for target 'example.o' failed
Hello @darrenjs
Can you please provide the compiler and the platform details ?
Never mind. I see the compiler in the snippet.
I have pushed a fix. Can you check it once ?
Thanks.
Fixed, thanks