This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33336] New: Using predefined macros inside the template function errors out in compilation
- From: "raviprakashg at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Sep 2007 16:09:33 -0000
- Subject: [Bug c++/33336] New: Using predefined macros inside the template function errors out in compilation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#include <string.h>
#define MEM_COPY(from,to,size) memcpy((to),(from),(size))
#define MEMCOPY(from,to,n_items,type) \
MEM_COPY((char *)(from),(char *)(to),(unsigned)(n_items)*sizeof(type))
template <typename T> class RPGVec
{
public:
virtual int Copy( RPGVec<T> &Vin);
}
template <typename T> int RPGVec<T>::Copy( RPGVec<T> &Vin)
{
MEMCOPY( Vin.Adr(), this->Adr(), 10, T);
return SUCCES;
}
error: there are no arguments to `MEM_COPY' that depend on a template
parameter, so a declaration of `MEM_COPY' must be available
How do I fix this ?
Thank you
--
Summary: Using predefined macros inside the template function
errors out in compilation
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: raviprakashg at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33336