Is there a way of marking methods/classes in C++ as obselete as I would to in c# as follows:
[Obsolete("You shouldn't use this method anymore.")] void foo(){}
I use the GNU toolchain/Eclipse CDT if that matters.
Is there a way of marking methods/classes in C++ as obselete as I would to in c# as follows:
[Obsolete("You shouldn't use this method anymore.")] void foo(){}
I use the GNU toolchain/Eclipse CDT if that matters.
Only using compiler dependent pragmas: look up the documentation
int old_fn () __attribute__ ((deprecated));
I don't know about the version of C++ you are using, but Microsoft's Visual C++ has a deprecated pragma. Perhaps your version has something similar.
The easiest way is with a #define DEPRECATED
. On GCC, it expands to __attribute__((deprecated))
, on Visual C++ it expands to __declspec(deprecated)
, and on compilers that do not have something silimar it expands to nothing.