Skip to content

Commit b593ba7

Browse files
committed
Rearrange [reflection.src_loc] to put definitions outside the synopsis section,
give the synopsis a "synop" stable name, and to put all creation operations together.
1 parent 05f0afc commit b593ba7

File tree

1 file changed

+84
-73
lines changed

1 file changed

+84
-73
lines changed

Diff for: reflection.html

+84-73
Original file line numberDiff line numberDiff line change
@@ -2,98 +2,63 @@
22
<h1>Reflection library</h1>
33

44
<cxx-section id="reflection.src_loc">
5-
<h1>Class source_location</h1>
5+
<h1>Class <code>source_location</code></h1>
66

7-
<cxx-section id="reflection.src_loc.intro">
8-
<h1>Header <code>&lt;experimental/source_location></code> synopsis</h1>
7+
<cxx-section id="reflection.src_loc.synop">
8+
<h1>Header <code>&lt;experimental/source_location></code> synopsis</h1>
99

1010
<pre><code>namespace std {
1111
namespace experimental {
1212
inline namespace fundamentals_v2 {
1313

1414
struct source_location {
15+
<cxx-ref insynopsis to="reflection.src_loc.creation"></cxx-ref>
16+
static constexpr source_location current() noexcept;
17+
1518
constexpr source_location() noexcept;
1619

20+
<cxx-ref insynopsis to="reflection.src_loc.fields"></cxx-ref>
1721
constexpr uint_least32_t line() const noexcept;
1822
constexpr uint_least32_t column() const noexcept;
1923
constexpr const char* file_name() const noexcept;
2024
constexpr const char* function_name() const noexcept;
21-
22-
static constexpr source_location current() noexcept;
2325
};
2426

2527
} // namespace fundamentals_v2
2628
} // namespace experimental
2729
} // namespace std</code></pre>
2830

29-
<p>
30-
<cxx-note>The intent of <code>source_location</code> is to have a small size and efficient copying.</cxx-note>
31-
</p>
32-
33-
<cxx-function>
34-
<cxx-signature>constexpr source_location() noexcept;</cxx-signature>
35-
36-
<cxx-effects>Constructs an object of class <code>source_location</code>.</cxx-effects>
37-
<cxx-remarks>The values are implementation-defined.</cxx-remarks>
38-
</cxx-function>
39-
40-
<cxx-function>
41-
<cxx-signature>constexpr uint_least32_t line() const noexcept;</cxx-signature>
42-
43-
<cxx-returns>The presumed line number (<cxx-ref in="cxx" to="cpp.predefined"></cxx-ref>) represented by this object.</cxx-returns>
44-
</cxx-function>
45-
46-
<cxx-function>
47-
<cxx-signature>constexpr uint_least32_t column() const noexcept;</cxx-signature>
48-
49-
<cxx-returns>
50-
An implementation-defined value representing
51-
some offset from the start of the line represented by this object.
52-
</cxx-returns>
53-
</cxx-function>
54-
55-
<cxx-function>
56-
<cxx-signature>constexpr const char* file_name() const noexcept;</cxx-signature>
57-
58-
<cxx-returns>
59-
The presumed name of the current source file (<cxx-ref in="cxx" to="cpp.predefined"></cxx-ref>)
60-
represented by this object as an NTBS.
61-
</cxx-returns>
62-
</cxx-function>
63-
64-
<cxx-function>
65-
<cxx-signature>constexpr const char* function_name() const noexcept;</cxx-signature>
66-
67-
<cxx-returns>
68-
If this object represents a position in the body of a function,
69-
returns an implementation-defined NTBS that should correspond to the function name.
70-
Otherwise, returns an empty string.
71-
</cxx-returns>
72-
</cxx-function>
73-
74-
<cxx-function>
75-
<cxx-signature>static constexpr source_location current() noexcept;</cxx-signature>
76-
77-
<cxx-returns>
78-
When invoked by a function call (<cxx-ref in="cxx" to="expr.call"></cxx-ref>)
79-
whose <cxx-grammarterm>postfix-expression</cxx-grammarterm> is
80-
a (possibly parenthesized) <cxx-grammarterm>id-expression</cxx-grammarterm> naming <code>current</code>,
81-
returns a <code>source_location</code> with an implementation-defined value.
82-
The value should be affected by <code>#line</code>
83-
(<cxx-ref in="cxx" to="cpp.line"></cxx-ref>) in the same manner as for <code>__LINE__</code> and <code>__FILE__</code>.
84-
If invoked in some other way, the value returned is unspecified.
85-
</cxx-returns>
86-
<cxx-remarks>
87-
When a <cxx-grammarterm>brace-or-equal-initializer</cxx-grammarterm> is used to initialize a non-static data member,
88-
any calls to <code>current</code> should correspond to the location of
89-
the constructor or aggregate initialization that initializes the member.
90-
</cxx-remarks>
9131
<p>
92-
<cxx-note>When used as a default argument (<cxx-ref in="cxx" to="dcl.fct.default"></cxx-ref>),
93-
the value of the <code>source_location</code> will be the location of the call to <code>current</code> at the call site.</cxx-note>
32+
<cxx-note>The intent of <code>source_location</code> is to have a small size and efficient copying.</cxx-note>
9433
</p>
95-
<cxx-example>
96-
<pre><code>struct s {
34+
</cxx-section>
35+
36+
<cxx-section id="reflection.src_loc.creation">
37+
<h1><code>source_location</code> creation</h1>
38+
39+
<cxx-function>
40+
<cxx-signature>static constexpr source_location current() noexcept;</cxx-signature>
41+
42+
<cxx-returns>
43+
When invoked by a function call (<cxx-ref in="cxx" to="expr.call"></cxx-ref>)
44+
whose <cxx-grammarterm>postfix-expression</cxx-grammarterm> is
45+
a (possibly parenthesized) <cxx-grammarterm>id-expression</cxx-grammarterm> naming <code>current</code>,
46+
returns a <code>source_location</code> with an implementation-defined value.
47+
The value should be affected by <code>#line</code>
48+
(<cxx-ref in="cxx" to="cpp.line"></cxx-ref>) in the same manner as for <code>__LINE__</code> and <code>__FILE__</code>.
49+
If invoked in some other way, the value returned is unspecified.
50+
</cxx-returns>
51+
<cxx-remarks>
52+
When a <cxx-grammarterm>brace-or-equal-initializer</cxx-grammarterm> is used to initialize a non-static data member,
53+
any calls to <code>current</code> should correspond to the location of
54+
the constructor or aggregate initialization that initializes the member.
55+
</cxx-remarks>
56+
<p>
57+
<cxx-note>When used as a default argument (<cxx-ref in="cxx" to="dcl.fct.default"></cxx-ref>),
58+
the value of the <code>source_location</code> will be the location of the call to <code>current</code> at the call site.</cxx-note>
59+
</p>
60+
<cxx-example>
61+
<pre><code>struct s {
9762
source_location member = source_location::current();
9863
int other_member;
9964
s(source_location loc = source_location::current())
@@ -115,7 +80,53 @@ <h1>Header <code>&lt;experimental/source_location></code> synopsis</h1>
11580
source_location c = source_location::current();
11681
f(c); // f<i>’s first argument gets the same values as </i>c<i>, above</i>
11782
}</code></pre>
118-
</cxx-example>
119-
</cxx-function>
83+
</cxx-example>
84+
</cxx-function>
85+
86+
<cxx-function>
87+
<cxx-signature>constexpr source_location() noexcept;</cxx-signature>
88+
89+
<cxx-effects>Constructs an object of class <code>source_location</code>.</cxx-effects>
90+
<cxx-remarks>The values are implementation-defined.</cxx-remarks>
91+
</cxx-function>
92+
</cxx-section>
93+
94+
<cxx-section id="reflection.src_loc.fields">
95+
<h1><code>source_location</code> field access</h1>
96+
97+
<cxx-function>
98+
<cxx-signature>constexpr uint_least32_t line() const noexcept;</cxx-signature>
99+
100+
<cxx-returns>The presumed line number (<cxx-ref in="cxx" to="cpp.predefined"></cxx-ref>) represented by this object.</cxx-returns>
101+
</cxx-function>
102+
103+
<cxx-function>
104+
<cxx-signature>constexpr uint_least32_t column() const noexcept;</cxx-signature>
105+
106+
<cxx-returns>
107+
An implementation-defined value representing
108+
some offset from the start of the line represented by this object.
109+
</cxx-returns>
110+
</cxx-function>
111+
112+
<cxx-function>
113+
<cxx-signature>constexpr const char* file_name() const noexcept;</cxx-signature>
114+
115+
<cxx-returns>
116+
The presumed name of the current source file (<cxx-ref in="cxx" to="cpp.predefined"></cxx-ref>)
117+
represented by this object as an NTBS.
118+
</cxx-returns>
119+
</cxx-function>
120+
121+
<cxx-function>
122+
<cxx-signature>constexpr const char* function_name() const noexcept;</cxx-signature>
123+
124+
<cxx-returns>
125+
If this object represents a position in the body of a function,
126+
returns an implementation-defined NTBS that should correspond to the function name.
127+
Otherwise, returns an empty string.
128+
</cxx-returns>
129+
</cxx-function>
130+
</cxx-section>
120131
</cxx-section>
121132
</cxx-clause>

0 commit comments

Comments
 (0)