pmed / v8pp

Bind C++ functions and classes into V8 JavaScript engine
http://pmed.github.io/v8pp/
Other
890 stars 120 forks source link

Fixed template parameter redefines default argument on clang++ #102

Closed paulsavoie closed 5 years ago

paulsavoie commented 5 years ago

using version on MacOS with LLVM 10.0.0

it prevents me from compiling if the default argument is specified twice

see https://stackoverflow.com/questions/14197436/c11-template-parameter-redefines-default-argument

pmed commented 5 years ago

Hi Paul,

Travis CI build (both with GCC and Clang compilers) has been failed due to error:

./v8pp/ptr_traits.hpp:38:22: error: too few template arguments for class template 'convert' using convert_ptr = convert<T*>;

As I understand, this convert template declaration with 2 arguments in the ptr_traits.hpp file seems to be the first for compiler, and below it expects these 2 template arguments.

The v8pp/ptr_traits.hpp include is an implementation detail, and should not be explicitly included in your code, please check this.

paulsavoie commented 5 years ago

Hello @pmed,

thank you for the fast response. You are absolutely right, I had imported ptr_traits.hpp directly.

I will close this pull request, but may have found some other issues (I had to change some things around to get v8pp to compile on my machine, but I'll investigate a bit more before I get back to you).

Have a happy new year!

pmed commented 5 years ago

Hi Paul,

thank you for the update. This is still a minor issue, that inclusion order, I'll think how to fix it. And of course other issues and pull requests are welcomed.

Happy New Year!