Questions

anonuser
Unregistered
 
Post: #16
infact something should be complaining about you redefining NULL

#define NULL 0

that is usually the standard, though not everywhere -_-

looks like you're not using the correct contructor..


did you try this?

static Pvector* nullv = new Pvector();

or
static Pvector nullv();

and namespaces are defined as follows

namespace samplenamespace {
//functions classes and stuff go here.

}

using namespace samplenamespace;

would import all of samplenamespace into the global namespace.

so you wouldn't need to do this
samplenamespace::sampleClass test;
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #17
anonuser Wrote:#define NULL 0

that is usually the standard, though not everywhere -_-

NULL is officially supposed to be (void *) 0, not the integer 0...

Alex Diener
Quote this message in a reply
anonuser
Unregistered
 
Post: #18
eh are you sure?
-bash-2.05b$ cat /usr/include/stdio.h | grep NULL
#ifndef NULL
#define NULL 0

which is from my stdio.h
Quote this message in a reply
idaydream
Unregistered
 
Post: #19
Basically, there is nothing wrong with

#ifndef NULL
#define NULL 0

and I tryied,

static Pvector nullv();
#undef NULL
#define NULL nullv.end()

at the place where error occurs.
But I believe NULL is not what makes a problem.
I still havn't solve the compilation error...
Quote this message in a reply
anonuser
Unregistered
 
Post: #20
dide you try a pointer ?

I don't know why it'd work but give it a shot.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #21
idaydream Wrote:static Pvector nullv();
#undef NULL
#define NULL nullv.end()
That's one of the most terrifying bits of code I've seen for quite a while.... Blink

Just guessing here, but it seems to me that the reason this is 'working' for you is that you're comparing an iterator with NULL somewhere when you should be comparing it with container.end().

I might be able to give a better diagnosis if you post the complete "error: candidates are: __gnu_cxx..." and "error: cannot convert: __gnu_cxx..." error messages. I think you chopped off the important bit in your post above!

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Post Reply