Unordered_map静态断言失败
unordered_map static assertion failed
由于静态断言失败错误,无法声明unordered_map。首先,什么是静态断言?我寻找答案,但文件对我来说是不理解的。下面是声明:
std::unordered_map<Point3D<int>, int> tree;
这是结构体Point3D
template <class T>
struct Point3D
{
public:
T x, y, z;
Point3D(T _x, T _y, T _z) : x(_x), y(_y), z(_z)
{
}
};
我能做什么或者应该做什么来让它工作?
谢谢!:)
在Visual Studio 2010下可以正常编译:
#include <unordered_map>
template <class T>
struct Point3D
{
public:
T x, y, z;
Point3D(T _x, T _y, T _z) : x(_x), y(_y), z(_z)
{
}
};
std::unordered_map<Point3D<int>, int> tree;
相关文章:
- 尝试使用 std::vector<std::thread时出现静态断言失败错误>
- uint_not_usable_without_attribute在业力规则中使用数字生成器时静态断言失败
- 从 exe 文件 (Visual Studio ) 启动时调试断言失败
- 在 CppUnit 中测试中止断言失败
- 使用扫描的调试断言失败
- 为什么我的Qt程序在断言失败后继续运行?
- 图片不显示,关闭时出错 --> 调试断言失败!表达式:is_block_type_valid(标头>_block_use)
- 访问提升:shared_ptr 主范围外崩溃,断言失败:px != 0.指针的正确用法是什么?
- C++ 调试断言失败 - 矢量下标超出视觉工作室的范围
- 错误:断言失败 (src.type() == CV_8UC1) 在阈值中
- Boost Beast 异步服务器失败,断言失败:(id_ != T::id) 在多个 aync 调用中
- 使用imwrite OpenCV时断言失败
- 调试断言失败的缓冲区!=nullptr
- 使用 ofstream 写入文本文件时断言失败
- 提升继续恢复断言失败
- 获取有关调试断言失败的错误:表达式:"(_Ptr_user &(_BIG_ALLOCATION_ALIGNMENT -1)) == 0" &&0
- OpenCV(3.4.1) 错误:断言失败(变暗 <= 2 && step[0] > 0) in cv::Mat::locateROI
- 在Win10上使用带有Qt5的OpenCV3.0,调试断言失败
- MFC GetDC() 断言失败 - "Not a window"
- OpenCV 错误:断言失败 - 矩阵减去