Slashdot Mirror


C++14 Is Set In Stone

jones_supa (887896) writes "Apart from minor editorial tweaks, the ISO C++14 standard can be considered completed. Implementations are already shipping by major suppliers. C++14 is mostly an incremental update over C++11 with some new features like function return type deduction, variable templates, binary literals, generic lambdas, and so on. The official C++14 specification release will arrive later in the year, but for now Wikipedia serves as a good overview of the feature set."

3 of 193 comments (clear)

  1. Re:Still... by Anonymous Coward · · Score: 5, Informative

    Though, annoyingly, they didn't seem to allow use of something like _ to break long literals up into human-readable groups.

    Yes they did. It's not underscore, it's apostrophe. For example:
            auto a = 0b100'0001; // ASCII 'A'
            auto million = 1'000'000;

    See here:
            http://isocpp.org/wiki/faq/cpp14-language#digit-separators>http://isocpp.org/wiki/faq/cpp14-language#digit-separators

  2. Re:Still... by Imagix · · Score: 5, Informative

    Uh, yes they do. Don't rely on summaries to list all of the features of the language. From N3797: An integer literal is a sequence of digits that has no period or exponent part, with optional separating single quotes that are ignored when determining its value. Example: The number twelve can be written 12, 014, 0XC, or 0b1100. The literals 1048576, 1’048’576, 0X100000, 0x10’0000, and 0’004’000’000 all have the same value. — end example

  3. Re:Why do we need Auto? by kthreadd · · Score: 5, Informative

    Auto does not mean loose typing. It still has a type, you just don't have to write it but it will be there and will be enforced by the compiler.