language: C++11 (gcc-4.7.2)
date: 289 days 8 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <functional>
#include <vector>
 
template<class T>
struct Identity{
  typedef T type;
};
 
template<class T>
void f(std::vector<T> v, 
    typename Identity<std::function<bool(T)>>::type func)
{
  // ...
}
 
int main(){
  std::vector<int> v;
  f(v, [](int){ return true; });
}