diff --git a/CPP-template-metaprogramming.org b/CPP-template-metaprogramming.org index c25162d..51175cf 100644 --- a/CPP-template-metaprogramming.org +++ b/CPP-template-metaprogramming.org @@ -323,9 +323,9 @@ Main function assembly (object-code): #+END_SRC As C++ supports function overloading and the object code need a unique -function name for every function, the compiler generates an unique name +function name for every function, the compiler generates a unique name for every function overload, classes and template classes. This -process of generating an unique this name is called *name mangling* or +process of generating a unique name is called *name mangling* or name decoration which is unique to every compiler. Due to the name mangling, the compiler (Clang) encodes the symbol of the overloaded function *describeArea* as ~_Z12describeAreaI6SquareEvRKT_~ and the @@ -1448,7 +1448,7 @@ identification and implement reflection. // ============= Example 3 - Template with int argument specialization ===// template const char* getNumberName(){ - return "I down't known"; + return "I don't known"; } template<> const char* getNumberName<0>(){ return "zero"; } template<> const char* getNumberName<1>(){ return "one"; } @@ -3174,7 +3174,7 @@ After defining the second overload function: *** Metafunction or type trait std::enable_if The metafunction (aka type trait) std::enable_if is used for -conditionally selectig a given overload function template from an +conditionally selecting a given overload function template from an overload set when the boolean argument is true or removing the function from the overload resolution when the boolean argument is false (SFINAE). diff --git a/Libraries-and-featuresCPP17.org b/Libraries-and-featuresCPP17.org index f2d517d..7fb2e41 100644 --- a/Libraries-and-featuresCPP17.org +++ b/Libraries-and-featuresCPP17.org @@ -154,7 +154,7 @@ SIMD CPU instructions. C++17 structured bindings allows to decompose data structures such as pairs, tuples, C-arrays and structs or classes with public fields in - an uniform way. + a uniform way. Example: + File: [[file:src/cpp17/cpp17-structured-bindings.cpp][file:src/cpp17/cpp17-structured-bindings.cpp]] @@ -290,7 +290,7 @@ SIMD CPU instructions. *** Functions and algorithms **** Algorithm std::clamp - Clamps the the input value to range [LOW, HIGH]: + Clamps the input value to range [LOW, HIGH]: + Header: [[https://en.cppreference.com/w/cpp/header/algorithm][]] + Documentation: [[https://en.cppreference.com/w/cpp/algorithm/clamp][std::clamp]] @@ -650,7 +650,7 @@ SIMD CPU instructions. :END: This example shows how to use the C++17 std::any container which comes - froom boost::any. + from boost::any. See: https://en.cppreference.com/w/cpp/utility/any