overloading operator new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.  I have implemented my own storage manager and I am trying to
overload the 'operator new' for an allocated block class and I get the
following errors.

powerpc-750-elf-gcc -c -r -gdwarf-2 -fno-exceptions -fno-weak -fno-check-new
cCommandDispatcher.cpp -o cCommandDispatcher.o
In file included from cCommandDispatcher.cpp:26:

cAllocatedBlock.h:69: error: declaration of 'operator new' as non-function
cAllocatedBlock.h:69: error: expected ';' before '(' token

from cAllocatedBlock.h ...

class cAllocatedBlock : public cQueueBlock
{	// cAllocatedBlock
public:
		...

            // Public Operators //

            void * operator new(size_t size);
            void operator delete(void * block);
		...

};          // cAllocatedBlock

I am using gcc-4.1.0 configured for a powerpc.  I am doing most of my
development on a pc using visual studio 2005, where this code compiles
without errors.  I find the error message itself perplexing.  What does it
mean by non-function?  What am I doing wrong?

Regards,
Kevin



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux