Skip to content

Commit 3b938b0

Browse files
jensmaurerzygoloid
authored andcommitted
Do not use \tcode for non-syntax.
This applies to inline, public, protected, private, and friend. Fixes #106.
1 parent ee1744f commit 3b938b0

10 files changed

+54
-95
lines changed

source/access.tex

+22-45
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
\begin{itemize}
1313
\item
1414
\indextext{access control!\idxcode{private}}%
15-
\tcode{private};
15+
private;
1616
that is, its name can be used only by members and friends
1717
of the class in which it is declared.
1818
\item
1919
\indextext{access control!\idxcode{protected}}%
20-
\tcode{protected};
20+
protected;
2121
that is, its name can be used only by members and friends
2222
of the class in which it is declared, by classes derived from that class, and by their
2323
friends (see~\ref{class.protected}).
2424
\item
2525
\indextext{access control!\idxcode{public}}%
26-
\tcode{public};
26+
public;
2727
that is, its name can be used anywhere without access restriction.
2828
\end{itemize}
2929

@@ -44,12 +44,8 @@
4444
\tcode{private}
4545
by default.
4646
Members of a class defined with the keywords
47-
\tcode{struct}
48-
or
49-
\tcode{union}
50-
are
51-
\tcode{public}
52-
by default.
47+
\tcode{struct} or \tcode{union}
48+
are public by default.
5349
\begin{example}
5450

5551
\begin{codeblock}
@@ -68,8 +64,7 @@
6864
referred to from declarations or expressions.
6965
\begin{note}
7066
Access control applies to names nominated by
71-
\tcode{friend}
72-
declarations\iref{class.friend} and
67+
friend declarations\iref{class.friend} and
7368
\grammarterm{using-declaration}{s}\iref{namespace.udecl}.
7469
\end{note}
7570
In the case of overloaded function names, access control is applied to
@@ -289,35 +284,23 @@
289284
If a class is declared to be a base class\iref{class.derived} for another class using the
290285
\tcode{public}
291286
access specifier, the
292-
\tcode{public}
293-
members of the base class are accessible as
294-
\tcode{public}
295-
members of the derived class and
296-
\tcode{protected}
297-
members of the base class are accessible as
298-
\tcode{protected}
299-
members of the derived class.
287+
public members of the base class are accessible as
288+
public members of the derived class and
289+
protected members of the base class are accessible as
290+
protected members of the derived class.
300291
If a class is declared to be a base class for another class using the
301292
\tcode{protected}
302293
access specifier, the
303-
\tcode{public}
304-
and
305-
\tcode{protected}
306-
members of the base class are accessible as
307-
\tcode{protected}
308-
members of the derived class.
294+
public and protected members of the base class are accessible as
295+
protected members of the derived class.
309296
If a class is declared to be a base class for another class using the
310-
\tcode{private}
297+
private
311298
access specifier, the
312-
\tcode{public}
313-
and
314-
\tcode{protected}
315-
members of the base class are accessible as
316-
\tcode{private}
299+
public and protected
300+
members of the base class are accessible as private
317301
members of the derived class.\footnote{As specified previously in \ref{class.access},
318302
private members of a base class remain inaccessible even to derived classes
319-
unless
320-
\tcode{friend}
303+
unless friend
321304
declarations within the base class definition are used to grant access explicitly.}
322305

323306
\pnum
@@ -673,7 +656,7 @@
673656
\end{example}
674657

675658
\pnum
676-
A \tcode{friend} declaration that does not declare a function
659+
A friend declaration that does not declare a function
677660
shall have one of the following forms:
678661

679662
\begin{ncsimplebnf}
@@ -682,12 +665,12 @@
682665
\terminal{friend} typename-specifier \terminal{;}
683666
\end{ncsimplebnf}
684667

685-
\begin{note} A \tcode{friend} declaration may be the
668+
\begin{note} A friend declaration may be the
686669
\term{declaration} in a \grammarterm{template-declaration}
687670
(\ref{temp}, \ref{temp.friend}).\end{note} If the
688671
type specifier in a \tcode{friend} declaration designates a (possibly
689672
cv-qualified) class type, that class is declared as a friend; otherwise, the
690-
\tcode{friend} declaration is ignored. \begin{example}
673+
friend declaration is ignored. \begin{example}
691674

692675
\begin{codeblock}
693676
class C;
@@ -720,8 +703,7 @@
720703

721704
\pnum
722705
\indextext{declaration!overloaded name and \tcode{friend}}%
723-
When a
724-
\tcode{friend}
706+
When a friend
725707
declaration refers to an overloaded name or operator, only the function specified
726708
by the parameter types becomes a friend.
727709
A member function of a class
@@ -758,8 +740,7 @@
758740

759741
\pnum
760742
Such a function is implicitly an inline function\iref{dcl.inline}.
761-
A
762-
\tcode{friend}
743+
A friend
763744
function defined in a class is in the (lexical) scope of the class in which it is defined.
764745
A friend function defined outside the class is not\iref{basic.lookup.unqual}.
765746

@@ -775,11 +756,7 @@
775756
A name nominated by a friend declaration shall be accessible in the scope of the
776757
class containing the friend declaration.
777758
The meaning of the friend declaration is the same whether the friend declaration
778-
appears in the
779-
\tcode{private},
780-
\tcode{protected}
781-
or
782-
\tcode{public}\iref{class.mem}
759+
appears in the private, protected, or public\iref{class.mem}
783760
portion of the class
784761
\grammarterm{member-specification}.
785762

source/basic.tex

+5-5
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@
12641264
\end{example}
12651265
\begin{note}
12661266
When looking for a prior declaration of a class
1267-
or function introduced by a \tcode{friend} declaration, scopes outside
1267+
or function introduced by a friend declaration, scopes outside
12681268
of the innermost enclosing namespace scope are not considered;
12691269
see~\ref{namespace.memdef}. \end{note} \begin{note} \ref{basic.scope.class}
12701270
further describes the restrictions on the use of names in a class
@@ -1344,16 +1344,16 @@
13441344
definitions. \end{note}
13451345

13461346
\pnum
1347-
Name lookup for a name used in the definition of a \tcode{friend}
1347+
Name lookup for a name used in the definition of a friend
13481348
function\iref{class.friend} defined inline in the class granting
13491349
friendship shall proceed as described for lookup in member function
1350-
definitions. If the \tcode{friend} function is not defined in the class
1351-
granting friendship, name lookup in the \tcode{friend} function
1350+
definitions. If the friend function is not defined in the class
1351+
granting friendship, name lookup in the friend function
13521352
definition shall proceed as described for lookup in namespace member
13531353
function definitions.
13541354

13551355
\pnum
1356-
In a \tcode{friend} declaration naming a member function, a name used in
1356+
In a friend declaration naming a member function, a name used in
13571357
the function declarator and not part of a \grammarterm{template-argument}
13581358
in the \grammarterm{declarator-id} is first looked up in the scope of the
13591359
member function's class\iref{class.member.lookup}. If it is not found,

source/classes.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
friend Vector operator*(const Matrix&, const Vector&);
384384
};
385385
\end{codeblock}
386-
Declaration of \tcode{friend}s is described in~\ref{class.friend},
386+
Declaration of friends is described in~\ref{class.friend},
387387
operator functions in~\ref{over.oper}.
388388
\end{example}
389389
\end{note}
@@ -639,10 +639,10 @@
639639
The
640640
\grammarterm{member-declarator-list} can be omitted only after a
641641
\grammarterm{class-specifier} or an \grammarterm{enum-specifier} or in a
642-
\tcode{friend} declaration\iref{class.friend}. A
642+
friend declaration\iref{class.friend}. A
643643
\grammarterm{pure-specifier} shall be used only in the declaration of a
644644
virtual function\iref{class.virtual}
645-
that is not a \tcode{friend} declaration.
645+
that is not a friend declaration.
646646

647647
\pnum
648648
The optional \grammarterm{attribute-specifier-seq} in a \grammarterm{member-declaration}
@@ -851,7 +851,7 @@
851851
\begin{note}
852852
There can be at most one definition of a non-inline member function in
853853
a program. There may be more than one
854-
\tcode{inline} member function definition in a program.
854+
inline member function definition in a program.
855855
See~\ref{basic.def.odr} and~\ref{dcl.inline}.
856856
\end{note}
857857

@@ -889,11 +889,11 @@
889889
\pnum
890890
\begin{note}
891891
A \tcode{static} local variable or local type in a member function always refers to
892-
the same entity, whether or not the member function is \tcode{inline}.
892+
the same entity, whether or not the member function is inline.
893893
\end{note}
894894

895895
\pnum
896-
Previously declared member functions may be mentioned in \tcode{friend} declarations.
896+
Previously declared member functions may be mentioned in friend declarations.
897897

898898
\pnum
899899
\indextext{local class!member function in}%
@@ -1724,7 +1724,7 @@
17241724
allowed in a declaration of an anonymous union in a class scope.
17251725
\indextext{access control!anonymous \tcode{union}}%
17261726
\indextext{restriction!anonymous \tcode{union}}%
1727-
An anonymous union shall not have \tcode{private} or \tcode{protected}
1727+
An anonymous union shall not have private or protected
17281728
members\iref{class.access}. An anonymous union shall not have
17291729
member functions.
17301730

source/declarations.tex

+5-5
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@
15191519
declaration to which the name in the
15201520
\grammarterm{elaborated-type-specifier} refers. This rule also applies to
15211521
the form of \grammarterm{elaborated-type-specifier} that declares a
1522-
\grammarterm{class-name} or \tcode{friend} class since it can be construed
1522+
\grammarterm{class-name} or friend class since it can be construed
15231523
as referring to the definition of the class. Thus, in any
15241524
\grammarterm{elaborated-type-specifier}, the \tcode{enum} keyword
15251525
shall be
@@ -2515,10 +2515,10 @@
25152515
\end{example}
25162516

25172517
\pnum
2518-
If a \tcode{friend} declaration in a non-local class first declares a
2518+
If a friend declaration in a non-local class first declares a
25192519
class, function, class template or function template\footnote{this implies that the name of the class or function is unqualified.}
25202520
the friend is a member of the innermost enclosing
2521-
namespace. The \tcode{friend} declaration does not by itself make the name
2521+
namespace. The friend declaration does not by itself make the name
25222522
visible to unqualified lookup\iref{basic.lookup.unqual} or qualified
25232523
lookup\iref{basic.lookup.qual}. \begin{note} The name of the friend will be
25242524
visible in its namespace if a matching declaration is provided at namespace
@@ -2528,12 +2528,12 @@
25282528
name lookup that considers functions from namespaces and classes
25292529
associated with the types of the function
25302530
arguments\iref{basic.lookup.argdep}. If the
2531-
name in a \tcode{friend} declaration is neither qualified nor a
2531+
name in a friend declaration is neither qualified nor a
25322532
\grammarterm{template-id} and the declaration is a function or an
25332533
\grammarterm{elaborated-type-specifier}, the lookup to determine whether
25342534
the entity has been previously declared shall not consider any scopes
25352535
outside the innermost enclosing namespace. \begin{note} The other forms of
2536-
\tcode{friend} declarations cannot declare a new member of the innermost
2536+
friend declarations cannot declare a new member of the innermost
25372537
enclosing namespace and thus follow the usual lookup rules.
25382538
\end{note}
25392539
\begin{example}

source/derived.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@
792792
cannot be a non-member\iref{dcl.fct.spec} function. Nor can a virtual
793793
function be a static member, since a virtual function call relies on a
794794
specific object for determining which function to invoke. A virtual
795-
function declared in one class can be declared a \tcode{friend} in
795+
function declared in one class can be declared a friend~(\ref{class.friend}) in
796796
another class.
797797
\end{note}
798798

source/expressions.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@
11481148
A member of a closure type shall not be
11491149
explicitly instantiated\iref{temp.explicit},
11501150
explicitly specialized\iref{temp.expl.spec}, or
1151-
named in a \tcode{friend} declaration\iref{class.friend}.
1151+
named in a friend declaration\iref{class.friend}.
11521152

11531153
\rSec3[expr.prim.lambda.capture]{Captures}%
11541154

@@ -2629,14 +2629,14 @@
26292629

26302630
\begin{itemize}
26312631
\item If, in the most derived object pointed (referred) to by \tcode{v},
2632-
\tcode{v} points (refers) to a \tcode{public} base class subobject of a
2632+
\tcode{v} points (refers) to a public base class subobject of a
26332633
\tcode{C} object, and if only one object of type \tcode{C} is derived
26342634
from the subobject pointed (referred) to by \tcode{v} the result points (refers) to that \tcode{C} object.
26352635

2636-
\item Otherwise, if \tcode{v} points (refers) to a \tcode{public} base
2636+
\item Otherwise, if \tcode{v} points (refers) to a public base
26372637
class subobject of the most derived object, and the type of the most
26382638
derived object has a base class, of type \tcode{C}, that is unambiguous
2639-
and \tcode{public}, the result points (refers) to the
2639+
and public, the result points (refers) to the
26402640
\tcode{C} subobject of the most derived object.
26412641

26422642
\item Otherwise, the

source/lib-intro.tex

+3-4
Original file line numberDiff line numberDiff line change
@@ -2707,7 +2707,7 @@
27072707
It is unspecified whether any
27082708
non-member
27092709
functions in the \Cpp standard library are defined as
2710-
\tcode{inline}\iref{dcl.inline}.
2710+
inline\iref{dcl.inline}.
27112711

27122712
\pnum
27132713
A call to a non-member function signature
@@ -2747,7 +2747,7 @@
27472747

27482748
\pnum
27492749
It is unspecified whether any member functions in the \Cpp standard library are defined as
2750-
\tcode{inline}\iref{dcl.inline}.
2750+
inline\iref{dcl.inline}.
27512751

27522752
\pnum
27532753
For a non-virtual member function described in the \Cpp standard library,
@@ -2856,8 +2856,7 @@
28562856
\indextext{protection}%
28572857
It is unspecified whether any function signature or class described in
28582858
\ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr} is a
2859-
\tcode{friend}
2860-
of another class in the \Cpp standard library.
2859+
friend of another class in the \Cpp standard library.
28612860
\indextext{specifier!\idxcode{friend}}
28622861

28632862
\rSec3[derivation]{Derived classes}

source/locales.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@
15831583
is provided so that the member functions on type
15841584
\tcode{char}
15851585
can be implemented
1586-
\tcode{inline}.\footnote{Only the
1586+
inline.\footnote{Only the
15871587
\tcode{char}
15881588
(not
15891589
\tcode{unsigned char}

source/numerics.tex

-6
Original file line numberDiff line numberDiff line change
@@ -6746,12 +6746,6 @@
67466746
matrix class nor a field class.
67476747
However, it is a very useful building block for designing such classes.}
67486748

6749-
\pnum
6750-
An implementation is permitted to qualify any of the functions declared in
6751-
\tcode{<valarray>}
6752-
as
6753-
\tcode{inline}.
6754-
67556749
\rSec3[valarray.cons]{\tcode{valarray} constructors}
67566750

67576751
\indexlibrary{\idxcode{valarray}!constructor}%

0 commit comments

Comments
 (0)