列出C ++的隐式类型转换。
因此,问题是,是否存在可以执行该表的类型特征?类似的东西
template <typename T, typename J>
struct promotion_type
{
typedef decltype(operator+(const T&,const J&)) type;
};
(不是我的问题,但这不能编译:
/home/user/source/testdir/main.cpp:97:51: error: there are no arguments to 'operator+' that depend on a template parameter, so a declaration of 'operator+' must be available [-fpermissive]
typedef decltype(operator+(const T&,const J&)) type;
^
/home/user/source/testdir/main.cpp:97:51: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
)
怎么decltype(std::declval<T>() + std::declval<J>())
样
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句