From 698ac6d5ff45e8f41d5ce0dca440e33f16111819 Mon Sep 17 00:00:00 2001 From: Anthony Calandra Date: Fri, 17 Feb 2023 23:06:23 -0500 Subject: [PATCH] Minor cosmetic changes: make attribute headers consistent; remove extra spacing in TOC. --- CPP17.md | 4 ++-- CPP20.md | 4 ++-- README.md | 13 ++++--------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CPP17.md b/CPP17.md index 2764761..630325e 100644 --- a/CPP17.md +++ b/CPP17.md @@ -17,7 +17,7 @@ C++17 includes the following new language features: - [constexpr if](#constexpr-if) - [utf-8 character literals](#utf-8-character-literals) - [direct-list-initialization of enums](#direct-list-initialization-of-enums) -- [fallthrough, nodiscard, maybe_unused attributes](#fallthrough-nodiscard-maybe_unused-attributes) +- [\[\[fallthrough\]\], \[\[nodiscard\]\], \[\[maybe_unused\]\] attributes](#fallthrough-nodiscard-maybe_unused-attributes) - [\_\_has\_include](#\_\_has\_include) C++17 includes the following new library features: @@ -265,7 +265,7 @@ byte d = byte{1}; // OK byte e = byte{256}; // ERROR ``` -### fallthrough, nodiscard, maybe_unused attributes +### \[\[fallthrough\]\], \[\[nodiscard\]\], \[\[maybe_unused\]\] attributes C++17 introduces three new attributes: `[[fallthrough]]`, `[[nodiscard]]` and `[[maybe_unused]]`. * `[[fallthrough]]` indicates to the compiler that falling through in a switch statement is intended behavior. This attribute may only be used in a switch statement, and must be placed before the next case/default label. ```c++ diff --git a/CPP20.md b/CPP20.md index dcca6a8..61df1fe 100644 --- a/CPP20.md +++ b/CPP20.md @@ -9,7 +9,7 @@ C++20 includes the following new language features: - [designated initializers](#designated-initializers) - [template syntax for lambdas](#template-syntax-for-lambdas) - [range-based for loop with initializer](#range-based-for-loop-with-initializer) -- [likely and unlikely attributes](#likely-and-unlikely-attributes) +- [\[\[likely\]\] and \[\[unlikely\]\] attributes](#likely-and-unlikely-attributes) - [deprecate implicit capture of this](#deprecate-implicit-capture-of-this) - [class types in non-type template parameters](#class-types-in-non-type-template-parameters) - [constexpr virtual functions](#constexpr-virtual-functions) @@ -265,7 +265,7 @@ for (auto v = std::vector{1, 2, 3}; auto& e : v) { // prints "123" ``` -### likely and unlikely attributes +### \[\[likely\]\] and \[\[unlikely\]\] attributes Provides a hint to the optimizer that the labelled statement has a high probability of being executed. ```c++ switch (n) { diff --git a/README.md b/README.md index cf6cac7..8e92528 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,13 @@ ## Overview - C++20 includes the following new language features: - [coroutines](#coroutines) - [concepts](#concepts) - [designated initializers](#designated-initializers) - [template syntax for lambdas](#template-syntax-for-lambdas) - [range-based for loop with initializer](#range-based-for-loop-with-initializer) -- [likely and unlikely attributes](#likely-and-unlikely-attributes) +- [\[\[likely\]\] and \[\[unlikely\]\] attributes](#likely-and-unlikely-attributes) - [deprecate implicit capture of this](#deprecate-implicit-capture-of-this) - [class types in non-type template parameters](#class-types-in-non-type-template-parameters) - [constexpr virtual functions](#constexpr-virtual-functions) @@ -34,7 +33,6 @@ C++20 includes the following new library features: - [std::midpoint](#stdmidpoint) - [std::to_array](#stdto_array) - C++17 includes the following new language features: - [template argument deduction for class templates](#template-argument-deduction-for-class-templates) - [declaring non-type template parameters with auto](#declaring-non-type-template-parameters-with-auto) @@ -49,7 +47,7 @@ C++17 includes the following new language features: - [constexpr if](#constexpr-if) - [utf-8 character literals](#utf-8-character-literals) - [direct-list-initialization of enums](#direct-list-initialization-of-enums) -- [fallthrough, nodiscard, maybe_unused attributes](#fallthrough-nodiscard-maybe_unused-attributes) +- [\[\[fallthrough\]\], \[\[nodiscard\]\], \[\[maybe_unused\]\] attributes](#fallthrough-nodiscard-maybe_unused-attributes) - [\_\_has\_include](#\_\_has\_include) C++17 includes the following new library features: @@ -80,7 +78,6 @@ C++14 includes the following new library features: - [compile-time integer sequences](#compile-time-integer-sequences) - [std::make_unique](#stdmake_unique) - C++11 includes the following new language features: - [move semantics](#move-semantics) - [variadic templates](#variadic-templates) @@ -133,8 +130,6 @@ C++11 includes the following new library features: - [std::async](#stdasync) - [std::begin/end](#stdbeginend) - - ## C++20 Language Features ### Coroutines @@ -366,7 +361,7 @@ for (auto v = std::vector{1, 2, 3}; auto& e : v) { // prints "123" ``` -### likely and unlikely attributes +### \[\[likely\]\] and \[\[unlikely\]\] attributes Provides a hint to the optimizer that the labelled statement has a high probability of being executed. ```c++ switch (n) { @@ -934,7 +929,7 @@ byte d = byte{1}; // OK byte e = byte{256}; // ERROR ``` -### fallthrough, nodiscard, maybe_unused attributes +### \[\[fallthrough\]\], \[\[nodiscard\]\], \[\[maybe_unused\]\] attributes C++17 introduces three new attributes: `[[fallthrough]]`, `[[nodiscard]]` and `[[maybe_unused]]`. * `[[fallthrough]]` indicates to the compiler that falling through in a switch statement is intended behavior. This attribute may only be used in a switch statement, and must be placed before the next case/default label. ```c++