C ++ 0x library availability in any compiler?

The standard will undoubtedly take years to create that stinks because it looks great. But I read it, and at least library additions (in particular, hash maps) would be very useful. I noticed in g ++ docs that I can get 4.3 or better, and use the flag to request new functions, regardless of what exists, but I was wondering if there is a way to get the library. And the fact that a lot of the best things have been built for boosting at present is really great, finally, a decent random number device has been built!

So, are there any compilers that I can use right now that have a fairly complete library in place, even if it cannot use some of the interesting new language features like auto?

+4
source share
6 answers

GCC with the option -std=c++0x already covers a pretty good subset of C ++ 0x. Version 4.4 is already quite convenient, 4.6 even more. It skips template aliases, but many of the extremely useful language features, as well as a very large part of the library, are fully functional.

Here is the complete list of features .

+3
source

If you want to use standard library extensions, you can use Boost . New enhancements to the standard library were mainly inspired by Boost libraries.

Regarding compiler support, Visual Studio 2010 supports a subset of the C ++ 11 standard , GCC currently has the best support for C ++ 11 , and Clang also adopts the new standard . I don’t know about other compilers, but I think they will follow soon.

+7
source

Besides GCC in -std=c++0x mode with its default libstdC ++ on all platforms supported by GCC, you can also use LLVM libc++ , which works well on Linux / BSD / Mac but has not yet been ported to Windows.

+3
source

GCC / libstdC ++ has most of the library in place, but may require the addition of tr1/ to include paths ( #include <tr1/unordered_map> for hashed maps). It also puts the new library in the std::tr1 namespace instead of just std .

(TR1 stands for Technical Report 1, which is a report describing the library additions for C ++ 0x.)

+1
source

Some of the libraries, and in particular the one you mentioned here (unordered_map), were defined as part of a technical review back in 2003 and were ported to the C ++ 0x standard, mostly unmodified. Most compilers have TR1 libraries implemented in the std::tr1 namespace.

Other libraries were extracted from other sources, Boost has become a great source of libraries for the upcoming standard ( function , bind , thread ...), but it depends on what you want to add to your project.

As for whether libraries can be extracted from C ++ 0x and used in a non-C ++ 0x compiler, you most likely will not be able to do this, because they will use new functions (think about move mechanisms), and this not compiled.

+1
source

Here is a link where you can find C ++ 0x support for most compilers

http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport

The list is updated whenever new C ++ 0x support is added. As you can see, g ++ has support for the maximum number of C ++ 0x functions at the moment.

0
source

All Articles