Skip to content

Commit

Permalink
Harmonize spacing for template headers.
Browse files Browse the repository at this point in the history
Use 'template<class T>'.
Also remove space between two closing template brackets in [lib].

Fixes cplusplus#53.
  • Loading branch information
jensmaurer committed Mar 5, 2017
1 parent 13cd3ff commit 52fdab7
Show file tree
Hide file tree
Showing 21 changed files with 2,633 additions and 2,630 deletions.
6 changes: 3 additions & 3 deletions source/access.tex
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@
points of use of the default \grammarterm{template-argument}. \begin{example}
\begin{codeblock}
class B { };
template <class T> class C {
template<class T> class C {
protected:
typedef T TT;
};

template <class U, class V = typename U::TT>
template<class U, class V = typename U::TT>
class D : public U { };

D <C<B> >* d; // access error, \tcode{C::TT} is protected
Expand Down Expand Up @@ -703,7 +703,7 @@
friend class D; // OK: elaborated-type-specifier declares new class
};

template <typename T> class R {
template<typename T> class R {
friend T;
};

Expand Down
34 changes: 17 additions & 17 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@

namespace std {
// \ref{alg.nonmodifying}, non-modifying sequence operations
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool all_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool all_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool any_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool any_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool none_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool none_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
InputIterator first, InputIterator last, Predicate pred);

Expand Down Expand Up @@ -285,7 +285,7 @@
Size count, const T& value,
BinaryPredicate pred);

template <class ForwardIterator, class Searcher>
template<class ForwardIterator, class Searcher>
ForwardIterator search(ForwardIterator first, ForwardIterator last,
const Searcher& searcher);

Expand Down Expand Up @@ -531,9 +531,9 @@
UniformRandomBitGenerator&& g);

// \ref{alg.partitions}, partitions
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool is_partitioned(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
InputIterator first, InputIterator last, Predicate pred);

Expand All @@ -555,13 +555,13 @@
BidirectionalIterator first,
BidirectionalIterator last,
Predicate pred);
template <class InputIterator, class OutputIterator1,
template<class InputIterator, class OutputIterator1,
class OutputIterator2, class Predicate>
pair<OutputIterator1, OutputIterator2>
partition_copy(InputIterator first, InputIterator last,
OutputIterator1 out_true, OutputIterator2 out_false,
Predicate pred);
template <class ExecutionPolicy, class InputIterator, class OutputIterator1,
template<class ExecutionPolicy, class InputIterator, class OutputIterator1,
class OutputIterator2, class Predicate>
pair<OutputIterator1, OutputIterator2>
partition_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
Expand Down Expand Up @@ -1440,9 +1440,9 @@

\indexlibrary{\idxcode{all_of}}%
\begin{itemdecl}
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool all_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool all_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
Predicate pred);
\end{itemdecl}
Expand All @@ -1461,9 +1461,9 @@

\indexlibrary{\idxcode{any_of}}%
\begin{itemdecl}
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool any_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool any_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
Predicate pred);
\end{itemdecl}
Expand All @@ -1482,9 +1482,9 @@

\indexlibrary{\idxcode{none_of}}%
\begin{itemdecl}
template <class InputIterator, class Predicate>
template<class InputIterator, class Predicate>
bool none_of(InputIterator first, InputIterator last, Predicate pred);
template <class ExecutionPolicy, class InputIterator, class Predicate>
template<class ExecutionPolicy, class InputIterator, class Predicate>
bool none_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
Predicate pred);
\end{itemdecl}
Expand Down
70 changes: 35 additions & 35 deletions source/atomics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace std {
// \ref{atomics.order}, order and consistency
enum memory_order;
template <class T>
template<class T>
T kill_dependency(T y) noexcept;

// \ref{atomics.lockfree}, lock-free property
Expand All @@ -57,7 +57,7 @@
// \ref{atomics.types.operations.general}, general operations on atomic types
// In the following declarations, \tcode{\placeholder{atomic-type}} is either \tcode{atomic<T>} or a named base class
// for \tcode{T} from Table~\ref{tab:atomics.integral} or inferred from Table~\ref{tab:atomics.typedefs} or from \tcode{bool}. If it is \tcode{atomic<T>},
// then the declaration is a template declaration prefixed with \tcode{template <class T>}.
// then the declaration is a template declaration prefixed with \tcode{template<class T>}.
bool atomic_is_lock_free(const volatile @\placeholder{atomic-type}@*) noexcept;
bool atomic_is_lock_free(const @\placeholder{atomic-type}@*) noexcept;
void atomic_init(volatile @\placeholder{atomic-type}@*@\itcorr[-1]@, T) noexcept;
Expand Down Expand Up @@ -88,51 +88,51 @@
memory_order, memory_order) noexcept;

// \ref{atomics.types.operations.templ}, templated operations on atomic types
template <class T>
template<class T>
T atomic_fetch_add(volatile @atomic<T>@*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_add(@atomic<T>@*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_add_explicit(volatile atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_add_explicit(atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_sub(volatile atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_sub(atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_sub_explicit(volatile atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_sub_explicit(atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_and(volatile atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_and(atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_and_explicit(volatile atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_and_explicit(atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_or(volatile atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_or(atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_or_explicit(volatile atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_or_explicit(atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_xor(volatile atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_xor(atomic<T>*, T) noexcept;
template <class T>
template<class T>
T atomic_fetch_xor_explicit(volatile atomic<T>*, T, memory_order) noexcept;
template <class T>
template<class T>
T atomic_fetch_xor_explicit(atomic<T>*, T, memory_order) noexcept;

// \ref{atomics.types.operations.arith}, arithmetic operations on atomic types
// In the following declarations, \tcode{\placeholder{atomic-integral}} is either \tcode{atomic<T>} or a named base class
// for \tcode{T} from Table~\ref{tab:atomics.integral} or inferred from Table~\ref{tab:atomics.typedefs}. If it is \tcode{atomic<T>}, then the declaration
// is a template specialization declaration prefixed with \tcode{template <>}.
// is a template specialization declaration prefixed with \tcode{template<>}.
@\placeholdernc{integral}@ atomic_fetch_add(volatile @\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@) noexcept;
@\placeholdernc{integral}@ atomic_fetch_add(@\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@) noexcept;
@\placeholdernc{integral}@ atomic_fetch_add_explicit(volatile @\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@, memory_order) noexcept;
Expand All @@ -155,21 +155,21 @@
@\placeholdernc{integral}@ atomic_fetch_xor_explicit(@\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@, memory_order) noexcept;

// \ref{atomics.types.operations.pointer}, non-member overloads for atomic<T*>
template <class T>
template<class T>
T* atomic_fetch_add(volatile atomic<T*>*, ptrdiff_t) noexcept;
template <class T>
template<class T>
T* atomic_fetch_add(atomic<T*>*, ptrdiff_t) noexcept;
template <class T>
template<class T>
T* atomic_fetch_add_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
template <class T>
template<class T>
T* atomic_fetch_add_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;
template <class T>
template<class T>
T* atomic_fetch_sub(volatile atomic<T*>*, ptrdiff_t) noexcept;
template <class T>
template<class T>
T* atomic_fetch_sub(atomic<T*>*, ptrdiff_t) noexcept;
template <class T>
template<class T>
T* atomic_fetch_sub_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
template <class T>
template<class T>
T* atomic_fetch_sub_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;

// \ref{atomics.types.operations.req}, initialization
Expand Down Expand Up @@ -364,7 +364,7 @@

\indexlibrary{\idxcode{kill_dependency}}%
\begin{itemdecl}
template <class T>
template<class T>
T kill_dependency(T y) noexcept;
\end{itemdecl}

Expand Down Expand Up @@ -437,7 +437,7 @@
\indexlibrary{\idxcode{atomic<\placeholder{integral}>}}%
\begin{codeblock}
namespace std {
template <class T> struct atomic {
template<class T> struct atomic {
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic} type's operations are always lock free}@;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
Expand Down Expand Up @@ -467,7 +467,7 @@
T operator=(T) noexcept;
};

template <> struct atomic<@\placeholder{integral}@> {
template<> struct atomic<@\placeholder{integral}@> {
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic} type's operations are always lock free}@;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
Expand Down Expand Up @@ -534,7 +534,7 @@
@\placeholdernc{integral}@ operator^=(@\placeholdernc{integral}@) noexcept;
};

template <class T> struct atomic<T*> {
template<class T> struct atomic<T*> {
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic} type's operations are always lock free}@;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
Expand Down
6 changes: 3 additions & 3 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@
typedef int AT;
void f1(AT);
void f2(float);
template <class T> void f3();
template<class T> void f3();
};
struct B {
typedef char AT;
Expand Down Expand Up @@ -2163,7 +2163,7 @@
namespace N {
struct A {
void g() { }
template <class T> operator T();
template<class T> operator T();
};
}

Expand Down Expand Up @@ -2374,7 +2374,7 @@

\begin{example}
\begin{codeblock}
template <class T> struct B {
template<class T> struct B {
void g(T) { }
void h(T);
friend void i(B, T) { }
Expand Down
8 changes: 4 additions & 4 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,8 @@
``\tcode{>>}'' closes two templates.

\begin{codeblock}
template <class T> struct X { };
template <int N> struct Y { };
template<class T> struct X { };
template<int N> struct Y { };
X< Y< 1 >> 2 > > x;
\end{codeblock}

Expand Down Expand Up @@ -1622,8 +1622,8 @@
\effect Valid \CppXIV code may fail to compile
or produce different results in this International Standard:
\begin{codeblock}
template <int N> struct A;
template <typename T, T N> int foo(A<N> *) = delete;
template<int N> struct A;
template<typename T, T N> int foo(A<N> *) = delete;
void foo(void *);
void bar(A<0> *p) {
foo(p); // ill-formed; previously well-formed
Expand Down
Loading

0 comments on commit 52fdab7

Please sign in to comment.