Ubuntu Pastebin

Paste from anpok at Tue, 11 Aug 2015 08:12:29 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
template<typename Obj, typename ...Args>
struct holder
{
    template<void(Obj::*mem_fn)(Args...)>
    struct thing
    {
    };
};

class A
{
public:
    void method(int x, int y);
};

template<typename Obj, typename ...Args>
holder<Obj,Args...> create_env(void(Obj::*fun)(Args...));

int main()
{
    using env = decltype(create_env(&A::method));
    using in_two = env::thing<&A::method>;
    using in_one = decltype(create_env(&A::method))::template thing<&A::method>;
};
Download as text