ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.47k stars 889 forks source link

error: invalid use of ‘class std::set<typename function_t: #232

Open moneroexamples opened 7 years ago

moneroexamples commented 7 years ago

Updated to newset gcc 7.1.1 in manjaro, and compilation of my project fails due to this error:

crow/routing.h:413:17: error: invalid use of ‘class std::set<typename function_t::arg<Indices>...>’
             ret.template set<
                 ^~~~~~~~
make[3]: *** [CMakeFiles/xmrblocks.dir/build.make:63: CMakeFiles/xmrblocks.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:70: CMakeFiles/xmrblocks.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:82: CMakeFiles/xmrblocks.dir/rule] Error 2
make: *** [Makefile:118: xmrblocks] Error 2

This is the problematic line:

https://github.com/ipkn/crow/blob/master/include/crow/routing.h#L413

Anyone knows how to rectify this problem?

moneroexamples commented 7 years ago

I solved this by renaming the set function to set2. For some reason in new gcc, using set bugs out as gcc wants to use std::std. The change is easy as set is used only in one file: routing.h.

So the changes were in 3 definition of set function:

void set2(Func f, typename std::enable_if<

and the line that was bugging out:

ret.template set2<typename function_t::template arg<Indices>...>(std::move(f));

This compiles fine.

joseprupi commented 7 years ago

Same problem here and solved reordering includes.

From https://github.com/ipkn/crow/issues/131