获取[enum成员?]

时间:2016-06-07 21:42:19

标签: c++

struct class1
{
    enum res
    {
        a = 9,
        b = 15
    };

    class1(res e) { }
};

struct class2
{
    enum res
    {
        he = 5,
        de = 2
    };

    class2(res e) {}
};

template<typename T, typename E>
void fn(E e)
{
    foo(T(e));
}

此功能有效,我可以将其称为fn<class2>(class2::he));,但我不想两次明确指定class2

有没有办法根据class2::he推断出类型“class2”?

1 个答案:

答案 0 :(得分:0)

如何定义一些辅助元函数来获得你想要的类型?

SELECT inter_id,
       COUNT(*) OVER (PARTITION BY customer_id, business_id, department_id, department_id, datetime_local
                      ORDER BY datetime_local
                     ) as cnt_samesamesame_day0,
       . . .