在参数中采用特定类型的向量的虚方法

时间:2016-09-07 21:09:31

标签: c++ c++11 visual-studio-2015

我尝试制作一个虚拟方法,在参数中使用特定类型的矢量。

这是父类:

template <typename T>
class Syncable
{
    virtual void update(vector<typename T::PropertyType>& properties) = 0
};

这是儿童班:

class MyUser : public Syncable <MyUser>
{
public:
    enum class Property
    {
        Id,
        DisplayName
    };
    using PropertyType = Property;

    virtual void update(vector<PropertyType>& properties) override
    {
        cout << "Update";
    }
};

但是,我收到以下错误:

error C2039: 'PropertyType': is not a member of 'MyUser

我认为可能会这样说,因为在Syncable类中,MyUser尚未定义。我该如何解决这个问题?

我使用的是Visual Studio 2015。

0 个答案:

没有答案
相关问题