当前位置:网站首页>【 genius_platform software platform development 】 : seventy-six vs the preprocessor definitions written cow force!!!!!!!!!!(in the other groups conding personnel told so cow force configuration to can
【 genius_platform software platform development 】 : seventy-six vs the preprocessor definitions written cow force!!!!!!!!!!(in the other groups conding personnel told so cow force configuration to can
2022-08-05 02:48:00 【随意的风】
vsAwesome way to write a preprocessor definition!!!!
1.问题概述
- Today, the small partners in the group are debugging the algorithm interface,Always crashes at the algorithm interface,发现vs提示信息为vector too long…The result algorithm guy told to set the precompiler definition
_HAS_ITERATOR_DEBUGGING=0
Cancel the macro definition.我擦,这是什么骚操作,It's okay to play like this,It looks like there is a problem,As a result, the definition of the macro cannot be cancelled in order to prove that this is the case,It is hereby verified;
2. main.cpp源代码(vs2017环境,其他vs环境都可以):
#ifdef _HAS_ITERATOR_DEBUGGING
#define x_1 1
#pragma message ("#define x_1 1")
#endif
#ifdef _HAS_ITERATOR_DEBUGGING
#define y_1 1
#pragma message ("#define y_1 1")
#endif
#include <iostream>
int main()
{
//int x = 0;
#ifdef _HAS_ITERATOR_DEBUGGING
{
printf("#ifdef _HAS_ITERATOR_DEBUGGING\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
#endif
if (_HAS_ITERATOR_DEBUGGING == 0)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 0)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
if (_HAS_ITERATOR_DEBUGGING == 1)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 1)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
if (_HAS_ITERATOR_DEBUGGING == 2)
{
printf("if (_HAS_ITERATOR_DEBUGGING == 2)\n");
printf("x_z = %d\n", _HAS_ITERATOR_DEBUGGING);
printf("x_1 = %d\n", x_1);
printf("y_1 = %d\n", y_1);
}
// printf("%d\n", vtkBooleanMacro(x,=,1));
std::cout << "Hello World!\n";
getchar();
}
3. The preprocessor is defined as_HAS_ITERATOR_DEBUGGING=0
3.1 See recompilelog
- This macro is predefined by the editor
_HAS_ITERATOR_DEBUGGING 为 0
,但是该_HAS_ITERATOR_DEBUGGING
still belong to the predefined state;
3.2 查看运行结果
#ifdef _HAS_ITERATOR_DEBUGGING
Judgments are predefined,或者使用if(_HAS_ITERATOR_DEBUGGING == 0/1)
This kind of shit is rare,Can't get it to cancel_HAS_ITERATOR_DEBUGGING
的定义
4. The preprocessor is defined as_HAS_ITERATOR_DEBUGGING=1
4.1 See recompilelog
- This macro is predefined by the editor
_HAS_ITERATOR_DEBUGGING 为 1
,但是该_HAS_ITERATOR_DEBUGGING
still belong to the predefined state;
4.1 查看运行结果
5. The preprocessor is defined as_HAS_ITERATOR_DEBUGGING=2
5.1 See recompilelog
- 编译阶段直接报错,如图;
6. 总结
- As long as it is defined in the preprocessor interface
_HAS_ITERATOR_DEBUGGING
宏,That is, the editor will define the macro during the editing phase.This macro will generally not be executed again=赋值操作
(Must be a cognitive error,I want to cancel the definition of this macro); - If you really want to play tricks、A mess of abnormal settings,Then it can only be set to 0/1(This is rarely used);And it can only be used in the program
if(_HAS_ITERATOR_DEBUGGING == xxxx)
Judgment in other forms,#ifdef _HAS_ITERATOR_DEBUGGING
always valid,Predefined macros; - I want to cancel the setting of a macro,配置成
_HAS_ITERATOR_DEBUGGING=0
It does not work to cancel the macro definition;Really want to cancel or remove the configuration of this macro;
边栏推荐
- private package
- Snapback - same tree
- Matlab map with color representation module value size arrow
- Data storage practice based on left-order traversal
- The 22-07-31 weeks summary
- Physical backup issues caused by soft links
- Go 微服务开发框架 DMicro 的设计思路
- 协作D2D局部模型聚合的半分散联合学习
- Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
- ARM Mailbox
猜你喜欢
剑指offer专项突击版第20天
word column notes
matlab绘制用颜色表示模值大小的箭头图
Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
QT language file production
Principle and Technology of Virtual Memory
链表的简单描述及代码的简单实现
nodeJs--encapsulate routing
C language diary 9 3 kinds of statements of if
lua学习
随机推荐
腾讯云【Hiflow】新时代自动化工具
Access Characteristics of Constructor under Inheritance Relationship
The 22-07-31 weeks summary
Error: Not a signal or slot declaration
02 [Development Server Resource Module]
语法基础(变量、输入输出、表达式与顺序语句)
基于左序遍历的数据存储实践
Lexicon - the maximum depth of a binary tree
tree table lookup
What should I do if the self-incrementing id of online MySQL is exhausted?
mysql tree structure query problem
北斗三号短报文终端露天矿山高边坡监测方案
Solve the problem of port occupancy Port xxxx was already in use
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)
QStyle平台风格
Go 微服务开发框架 DMicro 的设计思路
In 2022, you still can't "low code"?Data science can also play with Low-Code!
协作D2D局部模型聚合的半分散联合学习
虚拟内存原理与技术
Everyone in China said data, you need to focus on core characteristic is what?