Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CPP-template-metaprogramming.org
Original file line number Diff line number Diff line change
Expand Up @@ -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<Square>* as ~_Z12describeAreaI6SquareEvRKT_~ and the
Expand Down Expand Up @@ -1448,7 +1448,7 @@ identification and implement reflection.
// ============= Example 3 - Template with int argument specialization ===//
template<int>
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"; }
Expand Down Expand Up @@ -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).
Expand Down
6 changes: 3 additions & 3 deletions Libraries-and-featuresCPP17.org
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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][<algorithm>]]
+ Documentation: [[https://en.cppreference.com/w/cpp/algorithm/clamp][std::clamp]]
Expand Down Expand Up @@ -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

Expand Down