Skip to content

Commit

Permalink
try with typename
Browse files Browse the repository at this point in the history
  • Loading branch information
Momtchil Momtchev committed Dec 21, 2023
1 parent 55347d9 commit bfe38e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/noobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ template <class CLASS> class ClassDefinition {
public:
// Instance class method
template <auto MEMBER, const ReturnAttribute &RET = ReturnDefault, typename NAME = const char *,
std::enable_if_t<std::is_member_function_pointer_v<decltype(MEMBER)>, bool> = true>
typename std::enable_if_t<std::is_member_function_pointer_v<decltype(MEMBER)>, bool> = true>
ClassDefinition &def(NAME name) {
typename NoObjectWrap<CLASS>::InstanceMethodCallback wrapper;

Expand All @@ -423,7 +423,7 @@ template <class CLASS> class ClassDefinition {

// Instance class getter/setter
template <auto CLASS::*MEMBER, const PropertyAttribute &PROP = ReadWrite, typename NAME = const char *,
std::enable_if_t<std::is_member_object_pointer_v<decltype(MEMBER)>, bool> = true>
typename std::enable_if_t<std::is_member_object_pointer_v<decltype(MEMBER)>, bool> = true>
ClassDefinition &def(NAME name) {
typename NoObjectWrap<CLASS>::InstanceGetterCallback getter =
&NoObjectWrap<CLASS>::template GetterWrapper<decltype(getMemberPointerType(MEMBER)), MEMBER>;
Expand All @@ -437,7 +437,7 @@ template <class CLASS> class ClassDefinition {

// Static class method
template <auto *MEMBER, const ReturnAttribute &RET = ReturnDefault, typename NAME = const char *,
std::enable_if_t<std::is_function_v<std::remove_pointer_t<decltype(MEMBER)>>, bool> = true>
typename std::enable_if_t<std::is_function_v<std::remove_pointer_t<decltype(MEMBER)>>, bool> = true>
ClassDefinition &def(NAME name) {
Napi::Function::Callback wrapper;
if constexpr (RET.isAsync()) {
Expand All @@ -451,7 +451,7 @@ template <class CLASS> class ClassDefinition {

// Static class getter/setter
template <auto *MEMBER, const PropertyAttribute &PROP = ReadWrite, typename NAME = const char *,
std::enable_if_t<!std::is_function_v<std::remove_pointer_t<decltype(MEMBER)>>, bool> = true>
typename std::enable_if_t<!std::is_function_v<std::remove_pointer_t<decltype(MEMBER)>>, bool> = true>
ClassDefinition &def(NAME name) {
typename NoObjectWrap<CLASS>::StaticGetterCallback getter =
&GetterWrapper<std::remove_pointer_t<decltype(MEMBER)>, MEMBER>;
Expand Down

0 comments on commit bfe38e6

Please sign in to comment.