【发布时间】:2010-12-01 17:00:10
【问题描述】:
我有四个功能:
template<class Exception,class Argument>
void allocate_help(const Argument& arg,Int2Type<true>)const;
template<class Exception,class Argument>
std::nullptr_t allocate_help(const Argument& arg,Int2Type<false>)const;
template<class Exception>
void allocate_help(const Exception& ex,Int2Type<true>)const;
template<class Exception>
std::nullptr_t allocate_help(const Exception& ex,Int2Type<false>)const;
但是当我打电话时:
allocate_help<std::bad_alloc>(e,Int2Type<true>()); //here e is of a std::bad_alloc type
我收到一个错误:
错误 3 错误 C2668:对重载函数的模糊调用
为什么?
【问题讨论】:
标签: c++ overloading