从 MSVC14 切换到 MSVC16 会导致"compiler is out of heap space (C1060)"错误
Switching from MSVC14 to MSVC16 leads to "compiler is out of heap space (C1060)" error
我正试图从Visual Studio 14 2015
编译器切换到Visual Studio 16 2019
来编译我的项目(也尝试过Visual Studio 15 2017
,但这导致了相同的问题(。我使用的是irrequietus/typestring,它与旧编译器配合得很好,但现在会导致错误。
下面是一个应该与typestring一起使用的类:
// my_custom_class.h
template<typename T>
class MyCustomClass
{
public:
static bool compareTheTypestring(const std::string& other) const {
return std::strcmp(data(), other.c_str()) == 0;
}
}
这就是我如何使用类:
// use_it.cpp
#include "typestring.hh"
#include "my_custom_class.h"
typedef MyCustomClass<typestring_is("Foo")> FooCompare;
它在typestring.hh
中抛出以下错误:
compiler is out of heap space (C1060)
use_it.cpp
:中还有更多错误
irqus::typeek: no matching overloaded function found (C2672)
Failed to specialize function template 'unknown-type irqus::typeek(irqus::typestring<C...>)'
- 无法推导
MyCustomClass
的模板参数
存储库包含类似的问题,但维护人员似乎没有回复。我试图找到替代的typestring实现,但没有找到。有人能帮我解决这个问题吗?
此问题已在1月份报告,自那时以来已收到0条回复。图书馆似乎不再更新了。。。也许可以寻找替代解决方案
你真的应该在你的问题中加入你想做什么的细节。在我理解你想要实现的目标之前,我必须通读外部图书馆。我最好的建议是:寻找一个替代方案。还有其他编译时间字符串的方法。模板参数可能不是最好的答案。
如果真的想要使用模板参数字符串,您必须自己修复它。库可能依赖于未定义的行为。所以它现在坏了。我试过了,但不是很直接。您可能需要在宏中使用charizing运算符来拆分字符串,然后将字符放入元组类型中。。。
template<char c>
class CharType {
public:
static constexpr char Char = c;
};
using FooString = std::tuple<CharType<'F'>, CharType<'o'>, CharType<'o'>>;
或者类似的东西。
相关文章:
- Usages of std::move
- 使用 [] 运算符时"binding reference of type discards qualifiers"
- 如何处理 c++ 中类实现中的"invalid use of non-static data member"?
- 具有变量Number of Arguments的std::函数的矢量
- Capacity of a deque
- Deprecation of _writeBarrier()
- constexpr begin of a std::array
- 如何调整 std::vector of Eigen::MatrixXd 的大小
- C++ "error: invalid use of void expression"
- 为什么我的 heap.h 文件给我一个LNK2001错误?
- 我看到"use of undeclared identifier"错误,有人可以告诉我如何解决它吗?
- 赛通"Cannot take address of memoryview slice"
- C++ Version Of Double.longBitsToDouble
- 收到错误"invalid use of non-static data member 'stu::n' "
- C++ Usage of AsyncCallback
- 错误:"Left of getValue must have class/struct/union"
- 从 MSVC14 切换到 MSVC16 会导致"compiler is out of heap space (C1060)"错误
- 庞大的初始化列表,如何修复"fatal error C1060: compiler is out of heap space"
- 在析构函数中调用"delete"运算符时"compiler is out of heap space"编译器错误
- Corruption Of Heap