_THROW在GCC中没有定义
_THROW not defined in GCC?
请告诉我_THROW宏在GCC4中定义的位置或如何手动定义
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <climits>
#include <stdexcept>
#include <sys/cdefs.h>
#include <sys/types.h>
void test() { _THROW(std::range_error,"Test"); }
如果你想在c++中抛出一个异常,使用标准的c++ throw
关键字:
throw std::range_error("Test");
请避免使用特定于编译器的内部宏。
如果你必须定义它,你可以这样做:
#define _THROW(e, ...) throw e(__VA_ARGS__)
相关文章:
- 自定义对象的dlib序列化在gcc中失败
- "未定义对'WinMain@16'的引用"gcc 编辑器中的错误
- 在使用 GCC 4.8.5 构建的应用中对 cxx11 函数的未定义引用
- Cygwin下的gcc 9.3.0预处理器:cmdline -Dname,但名称似乎未定义
- thread_local静态成员模板定义:初始化失败,GCC
- 为什么这个自定义分配器的析构函数在 GCC/MSVS 的 stdlib 中被调用两次
- 使用自定义GCC位置构建软件包
- 是否有 GCC 标志来发出有关作用域内相同变量重定义的警告?
- 当它们不与GCC和CMAKE一起使用时,如何解析未定义的引用
- 为什么 gcc 7.3 接受静态定义中的'this'?
- 未定义的行为或 gcc 优化错误
- 所有版本的 GCC 都在与定义中具有默认类型的模板作斗争
- 带有 clang++ v4 和 gcc 6.3 库的自定义分配器
- GCC ARM 交叉编译,像未定义的引用"__cxa_end_catch@CXXABI_1.3"这样的错误表示什么?
- gcc 在这个概念定义中是否错误地评估了 std::d eclval ?
- 依赖GCC/LLVM的"-fexceptions"在技术上是未定义的行为吗?
- RHEL6 上的自定义 GCC 4.8.2 给出了 std::shared_ptr 的构建错误
- 为OS X搜索可以使用自定义gcc安装的C/ c++ IDE
- c++外部模板实例化和类型定义(gcc)
- 当使用(自定义)GCC 4时,Boost构建无法进行c++ 11特性检查.X或5