Skip to content

Commit 52fdab7

Browse files
committed
Harmonize spacing for template headers.
Use 'template<class T>'. Also remove space between two closing template brackets in [lib]. Fixes #53.
1 parent 13cd3ff commit 52fdab7

21 files changed

+2633
-2630
lines changed

source/access.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@
179179
points of use of the default \grammarterm{template-argument}. \begin{example}
180180
\begin{codeblock}
181181
class B { };
182-
template <class T> class C {
182+
template<class T> class C {
183183
protected:
184184
typedef T TT;
185185
};
186186

187-
template <class U, class V = typename U::TT>
187+
template<class U, class V = typename U::TT>
188188
class D : public U { };
189189

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

706-
template <typename T> class R {
706+
template<typename T> class R {
707707
friend T;
708708
};
709709

source/algorithms.tex

+17-17
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@
3131

3232
namespace std {
3333
// \ref{alg.nonmodifying}, non-modifying sequence operations
34-
template <class InputIterator, class Predicate>
34+
template<class InputIterator, class Predicate>
3535
bool all_of(InputIterator first, InputIterator last, Predicate pred);
36-
template <class ExecutionPolicy, class InputIterator, class Predicate>
36+
template<class ExecutionPolicy, class InputIterator, class Predicate>
3737
bool all_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
3838
InputIterator first, InputIterator last, Predicate pred);
39-
template <class InputIterator, class Predicate>
39+
template<class InputIterator, class Predicate>
4040
bool any_of(InputIterator first, InputIterator last, Predicate pred);
41-
template <class ExecutionPolicy, class InputIterator, class Predicate>
41+
template<class ExecutionPolicy, class InputIterator, class Predicate>
4242
bool any_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
4343
InputIterator first, InputIterator last, Predicate pred);
44-
template <class InputIterator, class Predicate>
44+
template<class InputIterator, class Predicate>
4545
bool none_of(InputIterator first, InputIterator last, Predicate pred);
46-
template <class ExecutionPolicy, class InputIterator, class Predicate>
46+
template<class ExecutionPolicy, class InputIterator, class Predicate>
4747
bool none_of(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
4848
InputIterator first, InputIterator last, Predicate pred);
4949

@@ -285,7 +285,7 @@
285285
Size count, const T& value,
286286
BinaryPredicate pred);
287287

288-
template <class ForwardIterator, class Searcher>
288+
template<class ForwardIterator, class Searcher>
289289
ForwardIterator search(ForwardIterator first, ForwardIterator last,
290290
const Searcher& searcher);
291291

@@ -531,9 +531,9 @@
531531
UniformRandomBitGenerator&& g);
532532

533533
// \ref{alg.partitions}, partitions
534-
template <class InputIterator, class Predicate>
534+
template<class InputIterator, class Predicate>
535535
bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
536-
template <class ExecutionPolicy, class InputIterator, class Predicate>
536+
template<class ExecutionPolicy, class InputIterator, class Predicate>
537537
bool is_partitioned(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
538538
InputIterator first, InputIterator last, Predicate pred);
539539

@@ -555,13 +555,13 @@
555555
BidirectionalIterator first,
556556
BidirectionalIterator last,
557557
Predicate pred);
558-
template <class InputIterator, class OutputIterator1,
558+
template<class InputIterator, class OutputIterator1,
559559
class OutputIterator2, class Predicate>
560560
pair<OutputIterator1, OutputIterator2>
561561
partition_copy(InputIterator first, InputIterator last,
562562
OutputIterator1 out_true, OutputIterator2 out_false,
563563
Predicate pred);
564-
template <class ExecutionPolicy, class InputIterator, class OutputIterator1,
564+
template<class ExecutionPolicy, class InputIterator, class OutputIterator1,
565565
class OutputIterator2, class Predicate>
566566
pair<OutputIterator1, OutputIterator2>
567567
partition_copy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
@@ -1440,9 +1440,9 @@
14401440

14411441
\indexlibrary{\idxcode{all_of}}%
14421442
\begin{itemdecl}
1443-
template <class InputIterator, class Predicate>
1443+
template<class InputIterator, class Predicate>
14441444
bool all_of(InputIterator first, InputIterator last, Predicate pred);
1445-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1445+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14461446
bool all_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14471447
Predicate pred);
14481448
\end{itemdecl}
@@ -1461,9 +1461,9 @@
14611461

14621462
\indexlibrary{\idxcode{any_of}}%
14631463
\begin{itemdecl}
1464-
template <class InputIterator, class Predicate>
1464+
template<class InputIterator, class Predicate>
14651465
bool any_of(InputIterator first, InputIterator last, Predicate pred);
1466-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1466+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14671467
bool any_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14681468
Predicate pred);
14691469
\end{itemdecl}
@@ -1482,9 +1482,9 @@
14821482

14831483
\indexlibrary{\idxcode{none_of}}%
14841484
\begin{itemdecl}
1485-
template <class InputIterator, class Predicate>
1485+
template<class InputIterator, class Predicate>
14861486
bool none_of(InputIterator first, InputIterator last, Predicate pred);
1487-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1487+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14881488
bool none_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14891489
Predicate pred);
14901490
\end{itemdecl}

source/atomics.tex

+35-35
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
namespace std {
3535
// \ref{atomics.order}, order and consistency
3636
enum memory_order;
37-
template <class T>
37+
template<class T>
3838
T kill_dependency(T y) noexcept;
3939

4040
// \ref{atomics.lockfree}, lock-free property
@@ -57,7 +57,7 @@
5757
// \ref{atomics.types.operations.general}, general operations on atomic types
5858
// In the following declarations, \tcode{\placeholder{atomic-type}} is either \tcode{atomic<T>} or a named base class
5959
// 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>},
60-
// then the declaration is a template declaration prefixed with \tcode{template <class T>}.
60+
// then the declaration is a template declaration prefixed with \tcode{template<class T>}.
6161
bool atomic_is_lock_free(const volatile @\placeholder{atomic-type}@*) noexcept;
6262
bool atomic_is_lock_free(const @\placeholder{atomic-type}@*) noexcept;
6363
void atomic_init(volatile @\placeholder{atomic-type}@*@\itcorr[-1]@, T) noexcept;
@@ -88,51 +88,51 @@
8888
memory_order, memory_order) noexcept;
8989

9090
// \ref{atomics.types.operations.templ}, templated operations on atomic types
91-
template <class T>
91+
template<class T>
9292
T atomic_fetch_add(volatile @atomic<T>@*, T) noexcept;
93-
template <class T>
93+
template<class T>
9494
T atomic_fetch_add(@atomic<T>@*, T) noexcept;
95-
template <class T>
95+
template<class T>
9696
T atomic_fetch_add_explicit(volatile atomic<T>*, T, memory_order) noexcept;
97-
template <class T>
97+
template<class T>
9898
T atomic_fetch_add_explicit(atomic<T>*, T, memory_order) noexcept;
99-
template <class T>
99+
template<class T>
100100
T atomic_fetch_sub(volatile atomic<T>*, T) noexcept;
101-
template <class T>
101+
template<class T>
102102
T atomic_fetch_sub(atomic<T>*, T) noexcept;
103-
template <class T>
103+
template<class T>
104104
T atomic_fetch_sub_explicit(volatile atomic<T>*, T, memory_order) noexcept;
105-
template <class T>
105+
template<class T>
106106
T atomic_fetch_sub_explicit(atomic<T>*, T, memory_order) noexcept;
107-
template <class T>
107+
template<class T>
108108
T atomic_fetch_and(volatile atomic<T>*, T) noexcept;
109-
template <class T>
109+
template<class T>
110110
T atomic_fetch_and(atomic<T>*, T) noexcept;
111-
template <class T>
111+
template<class T>
112112
T atomic_fetch_and_explicit(volatile atomic<T>*, T, memory_order) noexcept;
113-
template <class T>
113+
template<class T>
114114
T atomic_fetch_and_explicit(atomic<T>*, T, memory_order) noexcept;
115-
template <class T>
115+
template<class T>
116116
T atomic_fetch_or(volatile atomic<T>*, T) noexcept;
117-
template <class T>
117+
template<class T>
118118
T atomic_fetch_or(atomic<T>*, T) noexcept;
119-
template <class T>
119+
template<class T>
120120
T atomic_fetch_or_explicit(volatile atomic<T>*, T, memory_order) noexcept;
121-
template <class T>
121+
template<class T>
122122
T atomic_fetch_or_explicit(atomic<T>*, T, memory_order) noexcept;
123-
template <class T>
123+
template<class T>
124124
T atomic_fetch_xor(volatile atomic<T>*, T) noexcept;
125-
template <class T>
125+
template<class T>
126126
T atomic_fetch_xor(atomic<T>*, T) noexcept;
127-
template <class T>
127+
template<class T>
128128
T atomic_fetch_xor_explicit(volatile atomic<T>*, T, memory_order) noexcept;
129-
template <class T>
129+
template<class T>
130130
T atomic_fetch_xor_explicit(atomic<T>*, T, memory_order) noexcept;
131131

132132
// \ref{atomics.types.operations.arith}, arithmetic operations on atomic types
133133
// In the following declarations, \tcode{\placeholder{atomic-integral}} is either \tcode{atomic<T>} or a named base class
134134
// 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
135-
// is a template specialization declaration prefixed with \tcode{template <>}.
135+
// is a template specialization declaration prefixed with \tcode{template<>}.
136136
@\placeholdernc{integral}@ atomic_fetch_add(volatile @\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@) noexcept;
137137
@\placeholdernc{integral}@ atomic_fetch_add(@\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@) noexcept;
138138
@\placeholdernc{integral}@ atomic_fetch_add_explicit(volatile @\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@, memory_order) noexcept;
@@ -155,21 +155,21 @@
155155
@\placeholdernc{integral}@ atomic_fetch_xor_explicit(@\placeholder{atomic-integral}@*@\itcorr[-1]@, @\placeholdernc{integral}@, memory_order) noexcept;
156156

157157
// \ref{atomics.types.operations.pointer}, non-member overloads for atomic<T*>
158-
template <class T>
158+
template<class T>
159159
T* atomic_fetch_add(volatile atomic<T*>*, ptrdiff_t) noexcept;
160-
template <class T>
160+
template<class T>
161161
T* atomic_fetch_add(atomic<T*>*, ptrdiff_t) noexcept;
162-
template <class T>
162+
template<class T>
163163
T* atomic_fetch_add_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
164-
template <class T>
164+
template<class T>
165165
T* atomic_fetch_add_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;
166-
template <class T>
166+
template<class T>
167167
T* atomic_fetch_sub(volatile atomic<T*>*, ptrdiff_t) noexcept;
168-
template <class T>
168+
template<class T>
169169
T* atomic_fetch_sub(atomic<T*>*, ptrdiff_t) noexcept;
170-
template <class T>
170+
template<class T>
171171
T* atomic_fetch_sub_explicit(volatile atomic<T*>*, ptrdiff_t, memory_order) noexcept;
172-
template <class T>
172+
template<class T>
173173
T* atomic_fetch_sub_explicit(atomic<T*>*, ptrdiff_t, memory_order) noexcept;
174174

175175
// \ref{atomics.types.operations.req}, initialization
@@ -364,7 +364,7 @@
364364

365365
\indexlibrary{\idxcode{kill_dependency}}%
366366
\begin{itemdecl}
367-
template <class T>
367+
template<class T>
368368
T kill_dependency(T y) noexcept;
369369
\end{itemdecl}
370370

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

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

537-
template <class T> struct atomic<T*> {
537+
template<class T> struct atomic<T*> {
538538
static constexpr bool is_always_lock_free = @\impdefx{whether a given \tcode{atomic} type's operations are always lock free}@;
539539
bool is_lock_free() const volatile noexcept;
540540
bool is_lock_free() const noexcept;

source/basic.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@
13601360
typedef int AT;
13611361
void f1(AT);
13621362
void f2(float);
1363-
template <class T> void f3();
1363+
template<class T> void f3();
13641364
};
13651365
struct B {
13661366
typedef char AT;
@@ -2163,7 +2163,7 @@
21632163
namespace N {
21642164
struct A {
21652165
void g() { }
2166-
template <class T> operator T();
2166+
template<class T> operator T();
21672167
};
21682168
}
21692169

@@ -2374,7 +2374,7 @@
23742374

23752375
\begin{example}
23762376
\begin{codeblock}
2377-
template <class T> struct B {
2377+
template<class T> struct B {
23782378
void g(T) { }
23792379
void h(T);
23802380
friend void i(B, T) { }

source/compatibility.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,8 @@
994994
``\tcode{>>}'' closes two templates.
995995

996996
\begin{codeblock}
997-
template <class T> struct X { };
998-
template <int N> struct Y { };
997+
template<class T> struct X { };
998+
template<int N> struct Y { };
999999
X< Y< 1 >> 2 > > x;
10001000
\end{codeblock}
10011001

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

0 commit comments

Comments
 (0)