From cea20a82a4f0b48ede9543fe4a769ab8e78fb8e2 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 25 Sep 2014 10:46:51 -0700 Subject: c++11: Add discussion thread links, ban things that don't work with MSVS. Namely, ban __func__, constexpr, u"asdf", and char16_t. BUG=none R=jamesr@chromium.org Review URL: https://codereview.chromium.org/603043002 Cr-Commit-Position: refs/heads/master@{#296739} --- styleguide/c++/c++11.html | 127 ++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 65 deletions(-) (limited to 'styleguide/c++/c++11.html') diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html index 6b9ff82..978e435 100644 --- a/styleguide/c++/c++11.html +++ b/styleguide/c++/c++11.html @@ -70,7 +70,7 @@ C++ Templates Angle Brackets Pitfall final Indicates that a class or function is final and cannot be overridden final Language Reference -Recommended for new code. Existing uses of the FINAL macro will be replaced throughout the codebase. Discussion +Recommended for new code. Existing uses of the FINAL macro will be replaced throughout the codebase. Discussion thread @@ -121,11 +121,10 @@ and <inttypes>

C++11 Banned Features

-

None yet! This section will list C++11 features that are not allowed in the -Chromium codebase. +

This section will list C++11 features that are not allowed in the Chromium +codebase.

-

C++11 Features To Be Discussed

@@ -164,7 +206,7 @@ work in all our compilers yet.

using new_alias = typename Allow parameterized typedefs Type alias (using syntax) - +Discussion thread @@ -200,23 +242,13 @@ Style Guide on auto -Constant Expressions -constexpr -Compile-time constant expressions -TODO: documentation link -Not supported in MSVS2013. Google -Style Guide on constexpr - - - Declared Type Accessor decltype(expression) Provides a means to determine the type of an expression at compile-time, useful most often in templates. decltype specifier - +Discussion thread @@ -226,7 +258,7 @@ decltype specifier of the indicated function What's the point in defaulting functions in C++11? - +Discussion thread @@ -246,7 +278,7 @@ Default Template Arguments for Function Templates Allow overloaded constructors to use common initialization code Introduction to the C++11 feature: delegating constructors - +Discussion thread @@ -256,7 +288,7 @@ Introduction to the C++11 feature: delegating constructors conversion to booleans or integers enum-class - +Discussion thread @@ -268,8 +300,7 @@ and nested_exception std::exception Exceptions are banned by the - -C++ Style Guide. + C++ Style Guide. Discussion thread @@ -283,16 +314,6 @@ explicit specifier -Function Local Variable -__func__ -Provides a local variable of the name of the enclosing -function for logging purposes - -The __func__ Predeclared Identifier is Coming to C++ - - - - Function Suppression Function(arguments) = delete; Suppresses the implementation of a function, especially a @@ -307,7 +328,7 @@ synthetic function such as a copy constructor Allows any object of primitive, aggregate or class type to be initialized using brace syntax TODO: documentation link - +Discussion thread @@ -324,7 +345,7 @@ components [captures](params) -> ret { body } Anonymous functions Lambda functions -No default captures (Google Style Guide). +No default captures (Google Style Guide). Discussion thread @@ -333,7 +354,7 @@ components An integer of at least 64 bits Fundamental types - +Discussion thread @@ -356,7 +377,7 @@ Non-static data members Facilitates a more concise syntax for iterating over the elements of a container (or a range of iterators) in a for loop TODO: documentation link - +Discussion thread @@ -381,7 +402,7 @@ sequences, easing parsing in regex expressions, for example static_assert(bool, string) Tests compile-time conditions Static Assertion - +Discussion thread @@ -402,36 +423,12 @@ Union declarations -UTF-8 String Literals -u8"string" -Enforces UTF-8 encoding on all string literals - -string literal - - - - -UTF-16 and UTF-32 Support (16-Bit and 32-Bit Character Types) -char16_t and char32_t -Provides character types for handling 16-bit -and 32-bit code units (useful for encoding -UTF-16 and UTF-32 string data) - -Fundamental types -Non-UTF-8 text is banned by the - -C++ Style Guide. However, may be useful for -consuming non-ASCII data. - - - - Variadic Macros #define MACRO(...) Impl(args, __VA_ARGS__) Allows macros that accept a variable number of arguments Are Variadic macros nonstandard? - +Discussion thread @@ -439,7 +436,7 @@ Are Variadic macros nonstandard? template <typename ... arg> Allows templates that accept a variable number of arguments TODO: documentation link - +Discussion thread @@ -829,7 +826,7 @@ Algorithms library for a complete list. Allows trailing function return value syntax Declaring functions - +Discussion thread -- cgit v1.1