Skip to main content
  • 2773 Accesses

Abstract

We conventionally call “classic C++” the language in its final revision in 2003, as opposed to “modern C++” (also informally known as C++0x), introduced in 2011 and subsequently refined in 2014. The set of changes was huge, but the new rules in general were written to ease TMP and make the code less verbose. Additionally, compilers come with a new arsenal of standard classes, containers, language tools (like std::bind), and traits that expose meta-information previously known only to the compiler.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    As the situation is evolving quickly, refer to online documentation. It’s not easy to find a comparison table that is simultaneously complete and up-to-date, but at the time of this writing, good references are http://wiki.apache.org/stdcxx/C++0xCompilerSupport and http://cpprocks.com/c11-compiler-support-shootout-visual-studio-gcc-clang-intel/.

  2. 2.

    As a rule, however, it’s acceptable for metafunctions to return a “suboptimal” value. If a class destructor is known to be trivial, then the code may be optimized. A drastic assumption like “no destructor is trivial” will probably make the program slower, but it shouldn’t make it wrong.

  3. 3.

    They are described in the freely downloadable “Draft Technical Report on C++ Library Extensions” ( http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf ).

  4. 4.

    A list of metafunctions that ship with C++11-compliant compilers can be found here: http://en.cppreference.com/w/cpp/header/type_traits .

  5. 5.

    For a detailed explanation of the differences between auto and decltype, see [17].

  6. 6.

    The compiler will find the appropriate function with the standard overload resolution rules, as if it were a normal call.

  7. 7.

    Older compilers need not respect this behavior when both directives are present, so some use of the preprocessor may be required.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Davide Di Gennaro

About this chapter

Cite this chapter

Gennaro, D.D. (2015). C++0x. In: Advanced Metaprogramming in Classic C++. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1010-9_12

Download citation

Publish with us

Policies and ethics