开发者

Learning about C++ 0x features

开发者_StackOverflow Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.

What is a good place to learn about the new C++ 0x features? I understand that they may not have been fully finalized yet but it would be nice to get a head start. Also, what compilers currently support them?


An easy and fun way to learn about it is to watch the C++0x Overview Google Techtalk. Another good source is Bjarne Stroutstrup's C++0x FAQ which covers a huge portion of the new features.


For compiler support you can look here : C++0xCompilerSupport.

Compilers:

PAPER(S)
HP aCC
EDG eccp
gcc
Intel C++
MSVC
IBM XLC++
Sun C++
C++ Builder 2009/10


For VC++2010, here's the list of things that will be there.

Language (some of these were in VC2008 already as language extensions):

  • lambdas
  • static_assert
  • auto and decltype
  • rvalue references (T&&)
  • nullptr
  • extern template (note: not export!)
  • long long
  • no space required between closing > in nested templates (e.g. vector<vector<int>> is legal)

Libraries:

  • <stdint.h> / <cstdint> and all the typedefs within (at last!)
  • std::unique_ptr, std::shared_ptr and std::weak_ptr
  • std::forward_list
  • std::tuple and associated things (e.g. tie, get...)
  • <system_error>
  • <type_index>

What is NOT there:

  • initializer lists (curiously enough, header <initializer_list> is there and contains the respective type, but there seems to be no language support for it in beta 2)
  • variadic templates
  • constexpr
  • range-based for (though language extension for each, which is mostly similar, remains)
  • uniform initialization syntax {}
  • alternative function syntax (that mimicks lambdas)
  • constructor delegation
  • same-line member field initializers
  • [[override]] (but override remains as a language extension)
  • =default and =delete on members
  • enum class
  • using for type aliases, and template using
  • char16_t and char32_t, and the corresponding string literals
  • raw and user-defined string literals
  • sizeof on instance fields without object instance
  • std::thread and friends


You should certainly know about the official working group web site for ISO/IEC JTC1/SC22/WG21. This has the committee information, so it contains the official documents that are under development. However, it is not necessarily the best place to learn about the background ideas behind the various suggested ideas for C++0x.

Another place to look is the comp.std.c++ news group; this often has esoteric discussions of the minutiae of possible features.


This is not really about the language features but you might want to take a look at TR1. It's a specification of libraries that will most likley make it into C++0x.

There are actual implementations for it so you can play with it right now (for example a VC++ implementation by Microsoft).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜