Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.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
C++ 无序坐标集列表_C++_Compiler Errors_Stl - Fatal编程技术网

C++ 无序坐标集列表

C++ 无序坐标集列表,c++,compiler-errors,stl,C++,Compiler Errors,Stl,我试图列出一系列无序的坐标,作为生活游戏的主要模型。因此,我试图使以下代码正常工作: #包括 #包括 结构坐标{intx;inty;}; std::列表数据; 这个代码会导致很多错误(谢谢C++……),就像下面的那些: error: no match for call to ‘(const std::hash<coords>) (const coords&)’ error: ‘value’ is not a member of ‘std::__and_<std::_

我试图列出一系列无序的坐标,作为生活游戏的主要模型。因此,我试图使以下代码正常工作:

#包括
#包括
结构坐标{intx;inty;};
std::列表数据;

<>这个代码会导致很多错误(谢谢C++……),就像下面的那些:

error: no match for call to ‘(const std::hash<coords>) (const coords&)’
error: ‘value’ is not a member of ‘std::__and_<std::__is_fast_hash<std::hash<coords> >, std::__detail::__is_noexcept_hash<coords, std::hash<coords> > >’
error: ‘value’ is not a member of ‘std::__not_<std::__and_<std::__is_fast_hash<std::hash<coords> >, std::__detail::__is_noexcept_hash<coords, std::hash<coords> > > >’

and so on, and so forth.
错误:对“(const std::hash)(const coords&)的调用不匹配”
错误:“value”不是“std:\uu和\uu”的成员
错误:“value”不是“std:\ \非\的成员
等等,等等。

<> >强>这些错误是从哪里来的,更重要的是,我怎么能自己弄明白,这些错误看起来完全不可读?< /强> < />你如何编译你的代码?BTW,你不需要在C++中重复<代码>结构> /COD>关键字。使用下面的CMAKLISTS.TXT:<代码> SET(CMACHYCXXX标准11);项目(GOL_控制器CXX);添加库(GOL共享src/main.cpp)“由于这些错误看起来完全不可读,我怎么能自己发现呢?”在这个特殊的例子中,我在谷歌上搜索了“c++无序的自定义类型集”。但我同意,C++中的许多错误消息是可怕的,比如这个错误。这是TS概念的主要动机之一,希望在将来得到“Type
coords
必须是可散列的”这样的错误。@Magix不幸的是,它在C++17中不会出现,因为它还不够好。错误消息比预期的要详细得多,也不清楚。他们试图在C++20中获得一个改进的版本,希望是最好的。事实证明,C++标准化是很困难的。
error: no match for call to ‘(const std::hash<coords>) (const coords&)’
error: ‘value’ is not a member of ‘std::__and_<std::__is_fast_hash<std::hash<coords> >, std::__detail::__is_noexcept_hash<coords, std::hash<coords> > >’
error: ‘value’ is not a member of ‘std::__not_<std::__and_<std::__is_fast_hash<std::hash<coords> >, std::__detail::__is_noexcept_hash<coords, std::hash<coords> > > >’

and so on, and so forth.