Код: Выделить всё
template
struct Ptr
{
Ptr(T*);
};
< /code>
иерархия класса < /p>
struct Base {};
struct Derived : Base {};
< /code>
и набор перегрузки функций < /p>
void f(Ptr);
void f(Ptr);
void g(Ptr);
< /code>
Есть ли способ сделать операторы < /p>
f(new Base);
f(new Derived);
g(new Derived);
Подробнее здесь: https://stackoverflow.com/questions/796 ... onstructor
Мобильная версия