خرید بک لینک

Vote count: 0

C++ won't allow me to construct an object of type SymIntPoly and call f() on it. Below are the classes and the structure.

template<typename T>
struct SymPoly
{
    T f() { retu this->x; }
};

struct IntPoly
{
    int x;
    virtual int f() = 0;
};

struct SymIntPoly : public IntPoly, public SymPoly<int>
{
};

I do not know about compilers, but I feel that the compiler does not treat the two functions as the same functions (ie. they do not have the same inteal signature?)

The use case is that SymPoly

asked 45 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 17 تير 1395 ساعت: 19:45

صفحه بندی