...
class Andere;
class Klasse {
public:
Klasse() : bc(NULL, NULL){
}
private:
std::pair<Andere*, Andere*> bc;
};
...
Why could the above fail? Right, because NULL is not of type class Andere. (That works on the other compilers we have...)
...
class Andere;
class Klasse {
public:
Klasse() : bc(NULL, NULL){
}
private:
std::pair<Andere*, Andere*> bc;
};
...
6 comments:
Aren't you missing the template parameters in std::pair?
Could it be that VisualStudio does not like "NULL".
http://www2.research.att.com/~bs/bs_faq2.html#null
It seems the blogging software ate your template arguments (because of the <, >)
Ok, I fixed it, of course it ate the template parameters :-P
I would stick to Bjarne's advice:
http://www2.research.att.com/~bs/bs_faq2.html#null
C++0X have a new nullptr type for that, I think it is why. In other languages, real nulptr are a cool feature, not yet in C++, where they are somewhat as good as NULL, but in future version, it may be as good as in lua or so.
GCC 4.5 is also more selective when it come to accepting NULL. You can't do QString myString = NULL (be default) whilw ith previous versions, it worked. Now, I have to use "" in optional function parameter.
Post a Comment