Commit 1d2ad825 authored by Felix Hilsky's avatar Felix Hilsky
Browse files

c++ to C++

I searched for ' c++' since 'c++' also appears in all minted environments where it should not be changed.
Goal: standardize way of writing c++/C++ in text
parent 1be03f32
......@@ -119,7 +119,7 @@ from one (high-level) language to another (low-level) language.
\begin{itemize}
\item The process of compiling is performed by a program, called the \Index{compiler}. Typical examples of compilers are \emph{g++},
\emph{clang}, \emph{Intel ICC}, \emph{MSVC}, and others.
\item The compiler gets as input a \Index{translation unit}, typically a text file containing the c++ code -- the definition of functions and classes.
\item The compiler gets as input a \Index{translation unit}, typically a text file containing the C++ code -- the definition of functions and classes.
A program typically consists of many translation units that are combined)
\item The output of the compiler is a collection of \Index{object files}, one for each translation unit.
\item To generate an executable (or a library) from these object files, the \Index{linker} combines all the objects to a single file.
......@@ -135,7 +135,7 @@ The process of compiling can be split into several stages:
symbol table with jump references.
\end{description}
On many linux distributions the c++ compiler of the GNU Compiler Collection (GCC) or the clang compiler of LLVM are preinstalled.
On many linux distributions the C++ compiler of the GNU Compiler Collection (GCC) or the clang compiler of LLVM are preinstalled.
Assume the code from the introductory example is stored in a text file \texttt{distance.cc}. This can be compiled into an executable, by
%
\begin{verbatim}
......@@ -577,7 +577,7 @@ We call an initialization of a value to a smaller type that cannot represent thi
Maybe the compiler prints a warning, but not on all warning levels and this is not guaranteed.
\begin{guideline}{Principle}
Enable all warnings and stick to the c++ standard, \ie use the compiler flags \texttt{-Wall -Wextra -pedantic}, optionally you may
Enable all warnings and stick to the C++ standard, \ie use the compiler flags \texttt{-Wall -Wextra -pedantic}, optionally you may
even set the flag \texttt{-Werror} to assert an error instead of warnings.
\end{guideline}
......@@ -611,11 +611,11 @@ Some examples of narrowing conversions:
The\marginpar{[\cxx{17}]} curly braces, \ie uniform initialization, also works with the automatic type deduction \cpp{auto}. But be careful! The meaning
of the curly braces has changed in \cxx{17} and also before results sometimes in a type different from what you would expect.
\begin{minted}{c++}
auto x1 = {42}; // c++14 x1 is of type std::initializer_list<int>
auto x2 = {42}; // c++17 x2 is of type std::initializer_list<int>
auto x1 = {42}; // C++14 x1 is of type std::initializer_list<int>
auto x2 = {42}; // C++17 x2 is of type std::initializer_list<int>
auto x3{42}; // c++14: x3 is of type std::initializer_list<int>
auto x4{42}; // c++17: x4 is of type int
auto x3{42}; // C++14: x3 is of type std::initializer_list<int>
auto x4{42}; // C++17: x4 is of type int
\end{minted}
\end{rem}
......
......@@ -176,7 +176,7 @@ output arguments must be passed by (non-const) reference. The intend is that you
reference to the function where it is filled with values.
\begin{rem}
There is no only-output parameter type in c++, you can always read from the output variable. This is a source of errors so that some people prefer
There is no only-output parameter type in C++, you can always read from the output variable. This is a source of errors so that some people prefer
not to use output arguments, or use pointer arguments exclusively for this purpose, so that access to the value must be done explicitly.
\end{rem}
......
......@@ -142,7 +142,7 @@ library:
#include <array>
// ...
std::array<int, 3> vec1 = { 1.0, 2.0, 3.0 };
std::array vec2 = {1, 2, 3}; // with c++17
std::array vec2 = {1, 2, 3}; // with C++17
std::cout << vec1[1];
\end{minted}
......
......@@ -90,7 +90,7 @@ The syntax to declare a function template:
\end{minted}
It simply starts with the keyword \texttt{template} and in angular brackets \texttt{<...>} a comma separated list of template parameters.
The argument \texttt{NAMEx} is called \emph{template parameter} and must be a valid name in c++. The argument is introduced with either the
The argument \texttt{NAMEx} is called \emph{template parameter} and must be a valid name in C++. The argument is introduced with either the
additional keyword \texttt{typename} or \texttt{class} for type-parameters (there is no difference of these two keywords).
\begin{rem}
......@@ -299,7 +299,7 @@ The following example defines a class template of a container with fixed number
\end{minted}
\begin{rem}
Not all types are allowed as non-type template parameters. It must be possible to uniquely evaluate those types at compile-type. Therefore the c++
Not all types are allowed as non-type template parameters. It must be possible to uniquely evaluate those types at compile-type. Therefore the C++
standard has restricted non-type template parameters to integral types, enums, characters, and pointer types.
\end{rem}
......
......@@ -152,7 +152,7 @@ Without the \emph{capture} clause, it looks like a regular function definition.
\item \emph{parameters} is a list of function parameters including its types and qualifiers (like in regular function declarations)
\item \emph{ReturnType} is the (optional) (trailing) return type of the function, that can depend on the types of the function parameters
It can be omitted, resulting in the automatic return type deduction, like in functions returning \cpp{auto}.
\item The function body may contain any sequence of c++ statements and (optionally) a return statement.
\item The function body may contain any sequence of C++ statements and (optionally) a return statement.
\end{itemize}
\begin{example}
......
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