当前位置:网站首页>【 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=0Cancel 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_DEBUGGINGstill belong to the predefined state;
3.2 查看运行结果
#ifdef _HAS_ITERATOR_DEBUGGINGJudgments 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_DEBUGGINGstill 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_DEBUGGINGalways valid,Predefined macros; - I want to cancel the setting of a macro,配置成
_HAS_ITERATOR_DEBUGGING=0It does not work to cancel the macro definition;Really want to cancel or remove the configuration of this macro;
边栏推荐
- word column notes
- Tencent Cloud [Hiflow] New Era Automation Tool
- [ROS] (10) ROS Communication - Service Communication
- What should I do if the self-incrementing id of online MySQL is exhausted?
- PostgreSQL数据库 用navicat 打开表结构的时候报错 cannot update secondarysnapshot during a parallel operation 怎么解决?
- 使用二维码传输文件的小工具 - QFileTrans 1.2.0.1
- 2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。
- 你要的七夕文案,已为您整理好!
- Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
- 解决端口占用问题 Port xxxx was already in use
猜你喜欢

View handler 踩坑记录

RAID磁盘阵列
![[Decryption] Can the NFTs created by OpenSea for free appear in my wallet without being chained?](/img/81/2dcb61fd6c30f726804c73cf2b3384.jpg)
[Decryption] Can the NFTs created by OpenSea for free appear in my wallet without being chained?

How to sort multiple fields and multiple values in sql statement

RAID disk array

mysql can't Execute, please solve it

Matlab drawing 3

Matlab map with color representation module value size arrow

2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from

Go 微服务开发框架 DMicro 的设计思路
随机推荐
matlab绘制用颜色表示模值大小的箭头图
正则表达式,匹配中间的某一段字符串
C student management system Find student nodes based on student ID
行业案例|世界 500 强险企如何建设指标驱动的经营分析系统
腾讯云【Hiflow】新时代自动化工具
shell statement to modify txt file or sh file
Pisanix v0.2.0 released | Added support for dynamic read-write separation
word分栏小记
云原生(三十二) | Kubernetes篇之平台存储系统介绍
QStyle platform style
Chinese characters to Pinyin
Ant Sword Advanced Module Development
Industry case | insurance companies of the world's top 500 construction standards can be used to drive the business analysis system
语法基础(变量、输入输出、表达式与顺序语句)
Everyone in China said data, you need to focus on core characteristic is what?
Common hardware delays
How to sort multiple fields and multiple values in sql statement
Solve the problem of port occupancy Port xxxx was already in use
程序员的七夕浪漫时刻
QT language file production