A
aaragon
Hi everyone, I have a simple question. I'm trying to make a macro in
one file so I can use it in main.cpp. The idea is that I the user of
my code has simple to type the macro definition to replace a more
complicated code. Something like the following:
// file.h
#define OBJECTIVE template <class T> \
void operator()(T& chrom_,double* fitness_);
// file main.cpp
OBJECTIVE
{
// definition for objective
}
I've been trying to do this but it doesn't work. It seems that the
macros can only be used in the same file? Any suggestions? Thank you
all.
a^2
one file so I can use it in main.cpp. The idea is that I the user of
my code has simple to type the macro definition to replace a more
complicated code. Something like the following:
// file.h
#define OBJECTIVE template <class T> \
void operator()(T& chrom_,double* fitness_);
// file main.cpp
OBJECTIVE
{
// definition for objective
}
I've been trying to do this but it doesn't work. It seems that the
macros can only be used in the same file? Any suggestions? Thank you
all.
a^2