简体   繁体   English

C++ 使用 v typedef typename

[英]C++ using v typedef typename

Instead of using typedef typename for the iterator is it possible to use using keyword?可以使用using关键字代替使用typedef typename作为迭代器吗?

using schedulable_ops_t = std::list<mlir::Operation*>;
typedef typename schedulable_ops_t::iterator schedulable_ops_iterator_t;

I tried using schedulable_ops_t::iterator = schedulable_ops_iterator_t;我尝试using schedulable_ops_t::iterator = schedulable_ops_iterator_t; but I get an error is not a base type for type .但我得到一个错误is not a base type for type

This record这个记录

using schedulable_ops_t::iterator = schedulable_ops_iterator_t;

is incorrect.是不正确的。 It seems you mean看来你的意思

using schedulable_ops_iterator_t = typename schedulable_ops_t::iterator;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM