Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the name of the idiom for #defining a symbol to nothing?

Tags:

c++

If I see the line of code

#define IO_API __declspec(dllexport)

I would tell my colleagues "IO_API is defined to __declspec(dllexport)".

However, if I see the line of code

#define IO_API

I'm not sure what I would tell my colleagues briefly and unambiguously: any description tends to wander on a little. Is there a common descriptor?

Edit: I'm not looking for use cases here, merely a name for the idiom.

like image 841
hatcat Avatar asked Jan 04 '23 19:01

hatcat


1 Answers

Around here we just say

The macro IO_API expands to nothing.

or

The macro IO_API is empty.

It's really quite subjective but I think the former leads to the least amount of confusion.

like image 113
Hatted Rooster Avatar answered Feb 11 '23 08:02

Hatted Rooster