Skip to content

Commit 44266bf

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 d49359b commit 44266bf

21 files changed

+2617
-2617
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

+21-21
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}
@@ -1439,9 +1439,9 @@
14391439

14401440
\indexlibrary{\idxcode{all_of}}%
14411441
\begin{itemdecl}
1442-
template <class InputIterator, class Predicate>
1442+
template<class InputIterator, class Predicate>
14431443
bool all_of(InputIterator first, InputIterator last, Predicate pred);
1444-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1444+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14451445
bool all_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14461446
Predicate pred);
14471447
\end{itemdecl}
@@ -1460,9 +1460,9 @@
14601460

14611461
\indexlibrary{\idxcode{any_of}}%
14621462
\begin{itemdecl}
1463-
template <class InputIterator, class Predicate>
1463+
template<class InputIterator, class Predicate>
14641464
bool any_of(InputIterator first, InputIterator last, Predicate pred);
1465-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1465+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14661466
bool any_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14671467
Predicate pred);
14681468
\end{itemdecl}
@@ -1481,9 +1481,9 @@
14811481

14821482
\indexlibrary{\idxcode{none_of}}%
14831483
\begin{itemdecl}
1484-
template <class InputIterator, class Predicate>
1484+
template<class InputIterator, class Predicate>
14851485
bool none_of(InputIterator first, InputIterator last, Predicate pred);
1486-
template <class ExecutionPolicy, class InputIterator, class Predicate>
1486+
template<class ExecutionPolicy, class InputIterator, class Predicate>
14871487
bool none_of(ExecutionPolicy&& exec, InputIterator first, InputIterator last,
14881488
Predicate pred);
14891489
\end{itemdecl}
@@ -3341,9 +3341,9 @@
33413341

33423342
\indexlibrary{\idxcode{is_partitioned}}%
33433343
\begin{itemdecl}
3344-
template <class InputIterator, class Predicate>
3344+
template<class InputIterator, class Predicate>
33453345
bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
3346-
template <class ExecutionPolicy, class InputIterator, class Predicate>
3346+
template<class ExecutionPolicy, class InputIterator, class Predicate>
33473347
bool is_partitioned(ExecutionPolicy&& exec,
33483348
InputIterator first, InputIterator last, Predicate pred);
33493349
\end{itemdecl}
@@ -3448,13 +3448,13 @@
34483448

34493449
\indexlibrary{\idxcode{partition_copy}}%
34503450
\begin{itemdecl}
3451-
template <class InputIterator, class OutputIterator1,
3451+
template<class InputIterator, class OutputIterator1,
34523452
class OutputIterator2, class Predicate>
34533453
pair<OutputIterator1, OutputIterator2>
34543454
partition_copy(InputIterator first, InputIterator last,
34553455
OutputIterator1 out_true, OutputIterator2 out_false,
34563456
Predicate pred);
3457-
template <class ExecutionPolicy, class InputIterator, class OutputIterator1,
3457+
template<class ExecutionPolicy, class InputIterator, class OutputIterator1,
34583458
class OutputIterator2, class Predicate>
34593459
pair<OutputIterator1, OutputIterator2>
34603460
partition_copy(ExecutionPolicy&& exec,

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}, partial specializations for pointers
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
@@ -995,8 +995,8 @@
995995
``\tcode{\shr}'' closes two templates.
996996

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

@@ -1625,8 +1625,8 @@
16251625
\effect Valid \CppXIV code may fail to compile
16261626
or produce different results in this International Standard:
16271627
\begin{codeblock}
1628-
template <int N> struct A;
1629-
template <typename T, T N> int foo(A<N> *) = delete;
1628+
template<int N> struct A;
1629+
template<typename T, T N> int foo(A<N> *) = delete;
16301630
void foo(void *);
16311631
void bar(A<0> *p) {
16321632
foo(p); // ill-formed; previously well-formed

0 commit comments

Comments
 (0)