Commit 534b3f90 authored by Felix Hilsky's avatar Felix Hilsky
Browse files

remove some commas

commas are much rarer in English than in German. I'm no expert on this but but gut feel for English tells me that those commas shouldn't be there
parent 1d2ad825
......@@ -205,7 +205,7 @@ int& foo2() {
\end{minted}
\begin{rem}
Using \cpp{auto} return type might lead to unexpected behavior, if combined with references. The type that is returned is the raw type
Using \cpp{auto} return type might lead to unexpected behavior if combined with references. The type that is returned is the raw type
of the expression in the return statement, removing all top-level const and reference qualifiers:
\begin{minted}{c++}
auto f0(int i) { return i; } // -> int
......@@ -273,7 +273,7 @@ int main()
Some people prefer the naming \emph{deferred temporary materialization}, \ie the materialization of the value 42 happens in the \cpp{main()} when
assigned to the variable \cpp{x}.
This optimization or guarantee is especially important, if you want to return large objects created inside of the function. It is thus
This optimization or guarantee is especially important if you want to return large objects created inside of the function. It is thus
guaranteed that no expensive copy operation must be performed. (not even a move operation). The created objects simply materializes outside of
the function in the target variable.
......
......@@ -342,7 +342,7 @@ that is also initialized by a constructor call passing two arguments.
of the constructor arguments).
\textbf{Note}: If some member variables have default initializers, like \cpp{int dim = 2;} those initializations are appended to \underline{all} constructor
initializer lists, if no other value for that variable is prescribed.
initializer lists if no other value for that variable is prescribed.
% -------------------------------------------------------------------------------------------------
......@@ -367,7 +367,7 @@ MyPoint* q2 = new MyPoint{};
\end{minted}
If there is no other constructor defined, the compiler automatically generates a default constructor with default behavior, \ie that calls the default constructor
on each member variable (and base-class). For integral and floating-point types the default initializer value is \texttt{0}, if not specified otherwise by
on each member variable (and base-class). For integral and floating-point types the default initializer value is \texttt{0} if not specified otherwise by
putting the value in the variable definition, \ie \cpp{int dim = 2;}.
If there is any other constructor defined, one can force the compiler to generate the default constructor automatically, by adding the keyword \cpp{= default} to
......
......@@ -147,7 +147,7 @@ The type deduction thereby is very similar to the \cpp{auto} type deduction from
Actually, in C++ first the template parameter deduction was invented and later the auto-type deduction was added with \cxx{11}.
\begin{rem}
Argument type deduction only works, if all the types can be deduced uniquely from the function parameters. In the example above, we have
Argument type deduction only works if all the types can be deduced uniquely from the function parameters. In the example above, we have
declared a function template with two parameters and have specified both with the same template parameter \texttt{T}. Thus, we have to
pass two arguments of the same type to the function template in order to allow the template parameters to be deduced from the
function parameters:
......@@ -253,7 +253,7 @@ where \texttt{TYPES...} is a list of concrete types (without the keyword \texttt
\begin{rem}
With \marginpar{[\cxx{17}]}\cxx{17} the class template parameters can be automatically deduced from the class constructor arguments. This
is called \emph{class template argument deduction}. Similar to argument type deduction for function templates the template parameters
are deduced from the arguments passed to a constructor of the class template. This works, if all class template parameters are related to
are deduced from the arguments passed to a constructor of the class template. This works if all class template parameters are related to
a constructor parameter:
%
\begin{minted}{c++}
......
......@@ -261,5 +261,5 @@ invented template parameter for each placeholder is appended to the template par
void f2(auto const& arg); // same as template<class T> void f2(T const& arg)
\end{minted}
%
This is especially useful, if the actual type of the argument is irrelevant, but the algorithm allows to generically pass arguments of different
This is especially useful if the actual type of the argument is irrelevant but the algorithm allows to generically pass arguments of different
type.
......@@ -444,13 +444,13 @@ The output-iterator is incremented only if the predicate returns \cpp{true}.
\subsubsection{Back-inserter}
The problem with the copy algorithm is that we need to resize the output container before we can copy into it. In case of \cpp{copy_if} we even do
not know how many elements are copied. It would be better, if the algorithm itself could ``resize'' the container to the required size. But we
not know how many elements are copied. It would be better if the algorithm itself could ``resize'' the container to the required size. But we
do not get a container as input, but an iterator. This iterator has no functionality to resize the underlying container. It often does not even has
a reference to the container it points into.
A workaround for this problem is to use a different output-iterator. Not an iterator directly pointing to elements of the output-range, but a special
iterator wrapper that performs on assignment to the dereferenced iterator an \cpp{insert()} or \cpp{push_back()} operation. The corresponding
wrapper type is called \cpp{std::back_insert_iterator} ans is created using the function \cpp{std::back_inserter}.
wrapper type is called \cpp{std::back_insert_iterator} and is created using the function \cpp{std::back_inserter}.
%
\begin{minted}{c++}
#include <algorithm>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment