I've seen some codes like this:
#define A // macro
A void foo(bar); // function declaration
and this:
#define B // macro
class B foo { // class declaration
bar
};
What's the meaning of using a macro there?
Er...I mean I don't understand the grammar. I haven't seen this before.
In fact, I just find this kind of codes in features2d.hpp
in opencv3.1.
class CV_EXPORTS_W BOWImgDescriptorExtractor {
...
CV_WRAP void setVocabulary( const Mat& vocabulary );
...
}
In cvdef.h
#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS
# define CV_EXPORTS __declspec(dllexport)
#elif defined __GNUC__ && __GNUC__ >= 4
# define CV_EXPORTS __attribute__ ((visibility ("default")))
#else
# define CV_EXPORTS
#endif
/* special informative macros for wrapper generators */
#define CV_EXPORTS_W CV_EXPORTS
#define CV_WRAP
Here, CV_EXPORTS_W and CV_WRAP are macros. I haven't seen this kind of grammar in C++.