This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33336] New: Using predefined macros inside the template function errors out in compilation


#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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]