C++0x support macros

Wolfgang Bangerth bangerth at math.tamu.edu
Wed Jun 1 12:07:58 UTC 2011


> On subject, while it might make sense to be able to flag whether a project
> (I presume) is to be compiled for the new C++11 or the old C++93, and even
> be useful, it probably *is* a bit tricky and might not be worth it. If it
> is done, it should probably be read from the build system.

I don't see how you could do that. For example, for GCC a Makefile might 
contain the flag -std=c++0x; the name of the flag will also change its name 
once the standard is actually passed; there are various alternative spellings 
for the standards; other compilers might have different flags to achieve the 
same; and future compilers might simply default to C++11. The only options I 
see is 
- always assume the latest standard
- have a per-project flag (or if necessary a global flag) that offers to 
select between C++98 and C++11

I see little harm in the first option: KDevelop's parser in many places needs 
to assume code to be correct anyway. If you happen to autocomplete something 
to std::unordered_set, it might work in KDevelop but you'll get a compiler 
error later on. It might be slightly awkward to offer invalid completions but 
it's not like this would happen all the time.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/




More information about the KDevelop-devel mailing list