Before C++11
This section explains how attributes used to work before C++ 11.
We'll cover the following...
In the era of C++98/03, each compiler introduced its own set of annotations, usually with a different keyword.
Often, you could see code with #pragma
, __declspec
, __attribute
spread throughout the code.
Here’s the list of the common syntax from GCC/Clang and MSVC:
GCC Specific Attributes
GCC uses ...