fork download
  1. #include <vector>
  2.  
  3. template <class T, class F>
  4. class Bheap
  5. {
  6. public:
  7. Bheap(int allocateSize) {}
  8. void insert(T value, F f)
  9. {
  10. f(value,value);
  11. }
  12. void getMax();
  13. private:
  14. int sizeUsed;
  15. int allocateSize;
  16. std::vector<T> myBheap;
  17. };
  18.  
  19. void SomeFunction(int)
  20. {}
  21.  
  22. int main()
  23. {
  24. typedef void (*fn)(int);
  25. Bheap<int, fn> b(10);
  26. b.insert(10, SomeFunction);
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of 'void Bheap<T, F>::insert(T, F) [with T = int; F = void (*)(int)]':
prog.cpp:26:31:   required from here
prog.cpp:10:23: error: too many arguments to function
          f(value,value);
                       ^
stdout
Standard output is empty