首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

c++模版函数中使用typename

2012-07-05 
c++模版函数中应用typenamec++模版函数中应用typename 2011年06月21日  1------ Build started: Project:

c++模版函数中应用typename

c++模版函数中应用typename
2011年06月21日
  1>------ Build started: Project: test_is_Bsearch_postOrderTravel, Configuration: Debug Win32 ------
  1>Compiling...
  1>main.cpp
  1>e:\c++\test_is_bsearch_postordertravel\main.cpp(6 ) : warning C4346: 'std::vector::iterator' : dependent name is not a type
  1>        prefix with 'typename' to indicate a type
  1>e:\c++\test_is_bsearch_postordertravel\main.cpp(6 ) : error C2061: syntax error : identifier 'iterator'
  1>Build log was saved at "file://e:\C++\test_is_Bsearch_postOrderTravel\Deb ug\BuildLog.htm"
  1>test_is_Bsearch_postOrderTravel - 1 error(s), 1 warning(s)
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  可以正常的编译通过。具体原因可能是编译器不能确定vector::iterator是个类型还是个变量。可能跟编译器的实现有关系。

热点排行