fork download
  1. #include <functional>
  2.  
  3. template<class T>
  4. class Filter
  5. {
  6. public:
  7. typedef std::function<bool(const T&)> FilterFunc;
  8.  
  9. Filter(const FilterFunc & f = [](const T&){ return true; }) :
  10. f(f)
  11. {
  12. }
  13.  
  14. private:
  15. FilterFunc f;
  16. };
  17.  
  18. int main() {
  19. Filter<int> someInstance;
  20. }
Compilation error #stdin compilation error #stdout 0s 2892KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘Filter<T>::Filter(const FilterFunc&) [with T = int; Filter<T>::FilterFunc = std::function<bool(const int&)>]’:
prog.cpp:19:17: internal compiler error: in tsubst_copy, at cp/pt.c:12141
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /home/g9i3n9/cc82xcqE.out file, please attach this to your bugreport.
stdout
Standard output is empty