13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>auto x = 3.0; // Same as "double x = 3.0;"auto p = new auto(x); // Same as "double *p = new double(x);"struct S {static auto const m = 3; // Same as "static int const m = 3;"};• Trailing return types are allowed in top-level function declarators. These must be paired with the autotype specifier.auto f()->int*; // Same as: int *f();• The keyword decltype is supported: It allows types to be described in terms of expressions. Forexample:template struct S {decltype(f(T())) *p; // A pointer to the return type of f.};• The constraints on the code points implied by universal character names (UCNs) are slightly different:UCNs <strong>for</strong> surrogate code points (0xD000 through 0xDFFF) are never permitted, and UCN correspondingto control characters or to characters in the basic source character set are permitted in string literals.• Scoped enumeration types (defined with the keyword sequence enum class) and explicit underlyinginteger types <strong>for</strong> enumeration types are supported. For example:enum class Primary { red, green, blue };enum class Danger { green, yellow, red }; // No conflict on "red".enum Code: unsigned char { yes, no, maybe };void f() {Primary p = Primary::red; // Enum-qualifier is required to access// scoped enumerator constants.Code c = Code::maybe; // Enum qualifier is allowed (but not required)} // <strong>for</strong> unscoped enumeration types.• Lambdas are supported. For example:template int z(F f) { return f(0); }int g() {int v = 7;return z([v](int x)->int { return x+v; });}• The C99-style _Pragma operator is supported.• Rvalue references are supported. For example:int f(int);int &&rr = f(3);40

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!