Keil Logo

C++11 supported features

10.13 C++11 supported features

ARM Compiler supports a large subset of the language features of C++11.

Fully supported C++11 features

ARM Compiler fully supports the following language features as defined by the C++11 language standard:
  • auto can be used as a type specifier in declaration of a variable or reference.
  • constexpr.
  • Trailing return types are allowed in top-level function declarators.
  • Variadic templates.
  • Alias and alias template declarations such as using X = int.
  • Support for double right angle bracket token >> interpreted as template argument list termination.
  • static_assert.
  • Scoped enumerations with enum classes.
  • Unrestricted unions.
  • Extended friend class syntax extensions.
  • noexcept operator and specifier.
  • Non-static data member initializers.
  • Local and unnamed types can be used for template type arguments.
  • Use of extern keyword to suppress an explicit template instantiation.
  • Keyword final on class types and virtual functions.
  • Keyword override can be used on virtual functions.
  • Generation of move constructor and move assignment operator special member functions.
  • Functions can be deleted with =delete.
  • Raw and UTF-8 string literals.
  • Support for char16_t and char32_t character types and u and U string literals.
  • C99 language features accepted by the C++11 standard.
  • Type conversion functions can be marked explicit.
  • Inline namespaces.
  • Support for expressions in template deduction contexts.

Partially supported C++11 features with restrictions

ARM Compiler partially supports the following language features. You can use the feature, but restrictions might apply.
  • nullptr.
    ARM Compiler supports the keyword nullptr. However, the standard library header file does not contain a definition of std::nullptr_t. It can be defined manually using:
    namespace std
    	typedef decltype(nullptr) nullptr_t;
  • Rvalue references.
    ARM Compiler supports rvalue references and reference qualified member functions. However, the standard library provided with ARM Compiler does not come with an implementation of std::move or std::forward.
    Both std::move and std::forward are a static_cast with the target type deduced via template argument deduction. An example implementation is as follows:
    namespace std 
    	template< class T > struct remove_reference      {typedef T type;};
    	template< class T > struct remove_reference<T&>  {typedef T type;};
    	template< class T > struct remove_reference<T&&> {typedef T type;};
    	template<class T> 
    	typename remove_reference<T>::type&&
    	move(T&& a) noexcept
    		typedef typename remove_reference<T>::type&& RvalRef;
    		return static_cast<RvalRef>(a);
    	template<class T> 
    	forward(typename remove_reference<T>::type& a) noexcept
    		return static_cast<T&&>(a);
    ARM Compiler does not implement the C++11 value categories such as prvalue, xvalue and glvalue as described in A Taxonomy of Expression Value Categories. Instead it implements the draft C++0x definitions of lvalue and rvalue. In rare cases this may result in some differences in behavior from the C++11 standard when returning rvalue references from functions.
  • Initializer lists and uniform initialization.
    ARM Compiler supports initializer lists and uniform initialization, but the standard library does not provide an implementation of std::initializer_list. With a user-supplied implementation of std::initializer_list initializer lists and uniform initialization can be used.
  • Lambda functions
    ARM Compiler supports lambda functions. The standard library provided with the ARM Compiler does not provide an implementation of std::function. This means that lambda functions can only be used when type deduction is used.
    Within a function auto can be used to store the generated lambda function, a lambda can also be passed as a parameter to a function template, for example:
    #include <iostream>		
    template<typename T> void call_lambda(T lambda)
    void function()
    	auto lambda = [] () { std::cout << “Hello World”; };
  • Range-based for loops.
    ARM Compiler supports range-based for loops. However an implementation of std::initializer_list is required for range-based for loops with braced initializers, for example:
    for(auto x : {1,2,3}) { std::cout << x << std::endl; }
  • Decltype
    The decltype operator is supported, but does not include the C++11 extensions N3049 and N3276. This means that decltype cannot be used in all places allowed by the standard. In summary the following uses of decltype are not supported:
    • As a name qualifier, for example decltype(x)::count.
    • In destructor calls, for example p->~decltype(x)();.
    • As a base specifier, for example class X : decltype(Y) {};.
    • decltype construct cannot be a call to a function that has an incomplete type.
  • C++11 attribute syntax
    ARM Compiler supports the [[noreturn]] attribute.
    ARM Compiler ignores the [[carries_dependency]] attribute.
  • Delegating constructors
    Delegating constructors are supported by the compiler. However when exceptions are enabled you must link against up-to-date C++ runtime libraries.
  • Support of =default for special member functions
    Special member functions can be explicitly given default implementation with =default. ARM Compiler does not support this for the move constructor or move assignment operator special member functions. All other special member functions are supported. For example:
    struct X 
    	// The constructor, destructor, copy constructor 
    	// and copy assignment operator are supported
    	X() = default;
    	~X() = default;
    	X(const X&) = default;
    	X& operator=(const X&) = default;
    	// The move constructor and move assignment operator are not supported
    	X(const X&&) = default; 
    	X& operator=(const X&&) = default;

Unsupported C++11 features

The following language features are not supported in any way by ARM Compiler:
  • C++11 memory model guarantees.
  • The alignof operator and alignas specifier.
  • Inheriting constructors.
  • Thread local storage keyword thread_local.
  • User-defined literals.
  • Smart pointers.
  • Additions to the C++11 standard template library. ARM® Compiler 5 includes only the C++03 standard template library.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.