在使用新的C++11 using
关键字时,我遇到了问题。据我所知,它是typedef
的别名。但是我无法编译它。我想为std::vector
的迭代器定义一个别名。如果我使用这个,一切都能完美运行。
typedef std::vector<fix_point>::iterator inputIterator;
但如果我尝试:
using std::vector<fix_point>::iterator = inputIterator;
代码无法编译,出现以下错误:
Error: 'std::vector<fix_point>' is not a namespace
using std::vector<fix_point>::iterator = inputIterator;
^
为什么这段代码无法编译?