0
我想根據某些模板參數類型的常量使用boost :: mpl來控制某些指針類型的常量。這裏是我的嘗試:使用boost編譯錯誤:: mpl :: if_
template<typename T>
struct iter {
typedef typename boost::mpl::if_<boost::is_same<T, const list>, const sexpr *, sexpr *>::type pointer;
};
編譯器但是不接受這一說法:
sexpr.h:154: error: ISO C++ forbids declaration of `type name' with no type
sexpr.h:154: error: template argument 2 is invalid
sexpr.h:154: error: template argument 1 is invalid
sexpr.h:154: error: `type' does not name a type
任何線索我在做什麼錯?
謝謝!
那麼,你的結構後面沒有分號,如果有幫助的話。 – chris
我錯過了這篇文章,但我確實在代碼中有。 –
什麼是'list'? –