Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vector C++;不允许使用名称空间类型名称 我有一个C++命名空间< /p>的问题_Vector_Stl_Namespaces - Fatal编程技术网

Vector C++;不允许使用名称空间类型名称 我有一个C++命名空间< /p>的问题

Vector C++;不允许使用名称空间类型名称 我有一个C++命名空间< /p>的问题,vector,stl,namespaces,Vector,Stl,Namespaces,我想为某个框架的迭代器提供一个向量快捷方式。 这完全行得通 using namespace std; using namespace GS; typedef vector<vector<String> >::const_iterator table_iter; 这也会产生“错误:现在允许使用类型名” 显然,我能做到 using namespace std; //using namespace GS; typedef vector<vector<GS::S

我想为某个框架的迭代器提供一个向量快捷方式。 这完全行得通

using namespace std;
using namespace GS;

typedef vector<vector<String> >::const_iterator table_iter;
这也会产生“错误:现在允许使用类型名”

显然,我能做到

using namespace std;
//using namespace GS;

typedef vector<vector<GS::String> >::const_iterator table_iter;
提前谢谢


编辑:我无法编辑GS名称空间

vector
位于命名空间
std
中,因此您需要前缀
std::

using namespace GS;
typedef std::vector<std::vector<String> >::const_iterator table_iter;
但是,因为您只需要标准库中的
vector
,所以您也可以这样做:

using std::vector;
using namespace GS;
typedef vector<vector<String> >::const_iterator table_iter;

天啊。我现在觉得自己像个白痴。也许我应该睡一会儿。无论如何,谢谢!这很明显,但我的IDE向我展示了一些不同的东西,所以我完全忘记了std::vector。
typedef vector<vector<GS(YeahImUsingStd)::String> >::const_iterator table_iter;
using namespace GS;
typedef std::vector<std::vector<String> >::const_iterator table_iter;
typedef std::vector<std::vector<GS::String> >::const_iterator table_iter;
using std::vector;
using namespace GS;
typedef vector<vector<String> >::const_iterator table_iter;
typedef std::vector<std::vector<GS::String> >::const_iterator table_iter;