Looking forward to C++11, or not?

Pages: 12
Now where's that Migrating to C++11 article I'm waiting for?
Also Code::Blocks (10.05) is one year old, what version of GCC does it use anyway?
In fact what do you use for compiling C++11 code (apart from MSVC)?

(As for bumping the thread, sorry. I felt it can be recycled even though it's dead.)
Also Code::Blocks (10.05) is one year old, what version of GCC does it use anyway?
You can easily configure it to use any version on your system, so it doesn't really matter.
And the current nightly build is less than a month old... possibly less if they released another one while I wasn't looking.

PS: what's that with the first comments against auto? It's not just there to save typing work, one of the reasons it's there because it's often hard to tell for a human what exactly a template resolves to. And that might even change between different versions of a header.

I use GCC 4.7 (weekly builds) which I have to compile myself (takes ages). It supports many (but not all) of the new C++11 features.

Very quickly I found myself wondering how I ever did things differently.

Range based for: Cleans up the code a great deal.
auto keyword: likewise for some things, can lead to obscure code. I don't use this as much as I could for reasons of clarity.
threads: Great to have this standardised. Like the std::async() std::future<> interface.
regex: Looking forward to having this working. It is not finished in GCC 4.7
initializer-lists: It's great being able to create const std containers.
lambdas: This is fantastic. I'd hate to live without this now. Way better than bind.
static assertions: Love these.
smart pointers: Nice to have good standard versions
string literals: It is great to be able to avoid character escaping for some things.
Last edited on
Found this today, someone maintains Dev-C++, sort of...
http://orwellengine.blogspot.com/

Anyway, I noticed we have the dedicated cbegin() and cend() for const_iterator. And besides regex, a chrono library which I also have no idea how to use. Time for this site to refresh the Reference section...

Also, anyone using Netbeans or Eclipse for C++11?
I'm using eclipse. Why do you ask?
I'm using eclipse. Why do you ask?


Either I'm blind or neither IDE's site mentions C++11 support, so I was curious. I remember them using their own homebrew compiler, right?
Own homebrew compiler? I'm using GCC with eclipse. They do have an own build system though, which just means "we don't use make for organizing and building projects - unless you tell us to".

And it probably doesn't mention C++11 support because the support is still partial - partial means "most things work", but for example std::function is still not parsed correctly (so the editor will show a bunch of errors where there aren't any if you use std::function). But that's really the only thing I noticed that didn't work.
Eclipse can be configured to use any toolchain (at least, any that's cc-esque). It doesn't have its own compiler.
I don't know about Netbeans, but it's probably the same thing.
I use eclipse. It has reasonable grasp of C++11 as far as code checking and syntax highlighting goes . It understands range based for, initializer lists, lambda expressions, but croaks at keywords final and override.

You can make eclipse use any version of GCC, but that's not as easy as it could be. I still can't get it to autocomplete non c++03 system headers.

I pointed the "discovery options" at the version of GCC I wanted to use. That didn't completely work. So I turned "Discovery Options" off and added all the paths manually:

/home/galik/app/gcc-4.7.0/include/c++/4.7.0
/home/galik/app/gcc-4.7.0/include/c++/4.7.0/i686-pc-linux-gnu
/home/galik/app/gcc-4.7.0/lib/gcc/i686-pc-linux-gnu/4.7.0/include
/home/galik/app/gcc-4.7.0/include/c++/4.7.0/backward
/usr/include
/usr/local/include

You may need to add the library paths too but mine seems to have found those automatically... no idea how.

Then I needed to add a couple of environment variables: __GXX_EXPERIMENTAL_CXX__ and _GLIBCXX_USE_NANOSLEEP.

This may be easier for eclipse managed projects but I never use those, I always use external Makefile projects.
final and override aren't keywords, just identifiers that have special meanings at certain positions if I understood this correctly.
Last edited on
We already have final keyword and @Override annotation in Java. C++ seems to be chasing after Java tail :P
In the same way that C has been chasing after C++ since it added the const keyword. Which is to say, not at all.
Actually what I am trying to say is C++ moves "slowly" in comparison to Java in terms of new features and functions. STL was a very good BIG step forward but after that, it sort of slowed down a bit. This is neither bad or good but personally for me as a developer, I would prefer fast than slowed down.

PS I do know about the hare and tortoise race story. But the story is long over-due. In current days environment, do you seriously think tortoise can win the race ? :P
I do know about the hare and tortoise race story. But the story is long over-due. In current days environment, do you seriously think tortoise can win the race ?
That implies that there's a chase going on, which contradicts my previous statement.

What sort of analogy is that, anyway? Where does the track go through, and where does it end?

Actually what I am trying to say is C++ moves "slowly" in comparison to Java in terms of new features and functions


Actually Java has had lots of problems with development recently - caused mostly by poor financial condition of Sun, tookover by Oracle and also open-sourcing of JDK. It slowed down a lot. Lots of good features had to be postponed to Java 8. So the better analogy would be a snail (C++) vs tortoise (Java). ;)
Last edited on
Topic archived. No new replies allowed.
Pages: 12