涛 的个人资料徒然草的新园子照片日志列表更多 ![]() | 帮助 |
|
2009/3/3 why virtual template function is not allowed?
Guys, have you ever thought about this question? I was wondering if it's possible to have a virtual
template function. That is have a class, that has as one of its member
functions a templated function that is also pure virtual.
Hints provided by another guru: Graham February 23rd, 2003, 07:37 AM Think about it for a while: how could you make a templated virtual function? What's its signature? How many vtable entries do you reserve? How would you distinguish between an override/hide and an overload?
But, though c++ dose not allow virtual template function, you can also implement this function using boost::any, search for boos::any J. Best regards, Xie, Tao
引用通告此日志的引用通告 URL 是: http://xietao.spaces.live.com/blog/cns!E51FB178705E0AD0!1672.trak 引用此项的网络日志
|
|
|