编译错误:
dell@dell-PC /cygdrive/g/cyghome/src/cpptemplates/functors $ make g++.exe compose6.cpp -o test.exe
In file included from forwardparam.hpp:15,
from functionptr.hpp:11,
from funcptr.hpp:11,
from compose6.cpp:12:
typet.hpp:73: error: expected primary-expression before '>' token
typet.hpp: In instantiation of `IsFunctionT<double>':
typet.hpp:105: instantiated from `CompoundT<double>'
typet.hpp:290: instantiated from `TypeT<double>'
forwardparam.hpp:29: instantiated from `ForwardParamT<double>'
functionptr.hpp:39: instantiated from `FunctionPtr<double, double, double, voi
d>'
compose6.cpp:29: instantiated from here
typet.hpp:73: error: enumerator value for `Yes' not integer constant
make: *** [test.exe] Error 1
解决方法:去掉IsFunctionT<T>::
//enum { Yes = sizeof(IsFunctionT<T>::test<T>(0)) == 1 };
//error: expected primary-expression before '>' token enum { Yes =
sizeof(test<T>(0)) == 1 };
本文转sinojelly51CTO博客,原文链接:http://blog.51cto.com/sinojelly/99368,如需转载请自行联系原作者