thezbyg / gpick

Advanced color picker written in C++ using GTK+ toolkit
BSD 3-Clause "New" or "Revised" License
376 stars 33 forks source link

error: too many template arguments for class template 'Scoped' #218

Closed ryandesign closed 1 year ago

ryandesign commented 1 year ago

I can't compile gpick 0.3 at the moment due to its lua-c++ requirement so I'm trying to compile gpick 0.2.6 which fails on macOS with:

In file included from source/dynv/Xml.cpp:23:
source/common/Scoped.h:94:9: error: too many template arguments for class template 'Scoped'
        return Scoped<Callable, Args...>(callable, args...);
               ^                ~~~~~~~~
source/common/Scoped.h:37:8: note: template is declared here
struct Scoped;
       ^

I didn't see any other ticket reporting this error. The only hit on Google for this error was this summary of Debian builds that failed with clang but no solution mentioned there.

thezbyg commented 1 year ago

Hi, I managed to successfully build version 0.2.6 with clang 14.0.6 after making the following change to source/common/Scoped.h file:

--- source/common/Scoped.h
+++ source/common/Scoped.h
@@ -33,7 +33,7 @@
    return apply(f, t, std::make_index_sequence<size> {});
 }
 }
-template<typename>
+template<typename...>
 struct Scoped;
 template<typename... Args>
 struct Scoped<void (*)(Args...)> {

If compilation with this fix applied still fails for you, then I will need full error and compiler version.

ryandesign commented 1 year ago

Thanks, that lets me get past that error.