language: C++11 (gcc-4.7.2)
date: 190 days 6 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
 
using namespace std;
 
struct A
{
    static int f1(int a, int b)
    {
        return a + b;
    }
};
 
int f2(int a, int b)
{
    return a + b;
}
 
template <typename T, T X>
struct wrapper
{
    template <typename... Args>
    static bool value(Args... blargs)
    {
        return X(blargs...) == 3;
    }
};
 
int main()
{
    bool res;
    res = wrapper<decltype(&A::f1), &A::f1>::value(1,2);
    cout << res << endl;
    return 0;
}