Questions
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;
#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;
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
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
-bash-2.05b$ cat /usr/include/stdio.h | grep NULL
#ifndef NULL
#define NULL 0
which is from my stdio.h
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...
#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...
idaydream Wrote:static Pvector nullv();That's one of the most terrifying bits of code I've seen for quite a while....
#undef NULL
#define NULL nullv.end()

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!

