nullptr is not supported until C++0x (except in C++/CLI), and he may not be allowed to use the new language extensions. also, GCC doesn't support nullptr yet, but VC++ 2010 does. I'm not sure about other compilers.
Printable View
Well since I couldn't get help from my professor or fellow students, I thought I should go to different forums and see if I could get help from any of them.
But I have already specified in the other forums that my questions have been answered and that I do not need anymore help for now.
Language extensions sounds like non-standard things added to a language. But nullptr is standard, in the upcoming standard which is being finalized.
So yes, I stand by that. If your compiler doesn't support it, then make a define.
It's rather silly that GCC doesn't support it, as well. It is integral to the new standard library.
So for now, my program is running fine and my questions have been answered. Thanks to everyone who helped out.
According to GCC's C++0x support table, it is supported in g++ 4.6.0, but that is a very recent release.Quote:
Originally Posted by Elysia
it's actually not an official release yet. it's still in development.
since this is a class assignment, I would recommend sticking with NULL because that's what the teacher is likely to expect. most schools don't teach C++0x yet, and so aren't likely to accept code that uses new features.
Schools will never go over to C++0x if no one pushes them. Use nullptr and show that it is correct.
> Schools will never go over to C++0x if no one pushes them.
Especially since half the schools on the planet are still stuck with TurbidCrap, which pre-dates ALL standards for C and C++.
>> So yes, I stand by that. If your compiler doesn't support it, then make a define.
Naming defines after reserved words is basically a big no in terms of standards compliance. Besides, aren't you the one who insisted nullptr is more than #define nullptr (NULL) anyway? Why fake what you don't have?
What do you do when your compiler doesn't support nullptr and you have the latest, except scrapping it and getting a better one?
Just a thought ... out of a few hundred great C++ forums, being a member of at lease two should not be an issue with anyone what-so-ever. Sometime people is not available to help you because they my simply be too busy. So sometime, every now and then, you are FORCE to ask your other ONLY favorite forum in the world. Problem is, one should never join a third or a forth forum just because they talking code that is related to your most important question. So if you are lucky, you at the very lease have two to pray for while waiting for an response. with only two fingers crossed and not ALL four.Quote:
FYI: Also asked here
btw: This is our subject for next week class :)
considering the fact that the new standard was just made official a few months ago, you can't expect all vendors to have instant support for all of the new features. remember that MSVC is maintained and developed by a corporation that employs full time developers. the people who work on GCC are mostly volunteers, who have other jobs, and can't devote as much time to it as they would if it was their primary occupation.
Actually, the new standard has not yet been published.Quote:
Originally Posted by Elkvis
which only serves to strengthen my point - thanks laserlight. I don't intend to start an argument or anything, but forcing people to conform to a standard that isn't even official yet is just silly. it's certainly useful to be aware of the new features supported by the upcoming standard, and familiarize yourself with them so you can use them when compilers inevitably support them, but since many don't, and since it isn't required of them, it might be a good idea to slow your roll a little bit on telling people that they have to write code that conforms to the new standard.