Hi ,
I have a file in which macros are defined as below:-

# define INSTANTIATE_CACHE_X(X_DECL, T) \
template class X_DECL cache_item<T>; \
template class X_DECL vector<cache_item<T> >; \
template class X_DECL Db_cache<T>; \
T* Db_cache<T>:perator[] (const size_t index) \
{ \
return (*slots)[index].record; \
} \
\
size_t Db_cache<T>::get_cache_size( void ) \
{ \
return slots->size(); \
} \
\
void Db_cache<T>::clear( void ) \
{ \
vector<cache_item<T> >::iterator slot_i; \
\
for ( slot_i = slots->begin(); slot_i != slots->end(); slot_i++ ) \
{ \
slot_i->query = string(); \
slot_i->row = 0; \
} \
} \
\
Db_cache<T> Db_table<T>::cache;

# define INSTANTIATE_CACHE(T) INSTANTIATE_CACHE_X(CLASS_DECL, T)

# define PLUGIN_INSTANTIATE_CACHE(T) INSTANTIATE_CACHE_X(, T)

Now, in another file,macro #2 is being used as -

INSTANTIATE_CACHE(Version)
template class CLASS_DECL Db_table;

I am getting following errors:-

[C++ Error] TIVER.CPP(60): E2171 Body has already been defined for
function 'Db_cache:perator [](unsigned int)'
[C++ Error] TIVER.CPP(60): E2171 Body has already been defined for
function 'Db_cache::get_cache_size()'
[C++ Error] TIVER.CPP(60): E2171 Body has already been defined for
function 'Db_cache::clear()'

Any solutions are welcome.

Thanks,
Amit