Skip to content

Commit d80b5bd

Browse files
committed
[lib] Drop 'inline' from 'inline constexpr' variable templates.
Since CWG2387, constexpr variable templates have external linkage.
1 parent 4cea882 commit d80b5bd

File tree

10 files changed

+158
-159
lines changed

10 files changed

+158
-159
lines changed

source/concepts.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@
769769

770770
\begin{itemdecl}
771771
template<class T>
772-
inline constexpr bool @\exposid{is-default-initializable}@ = @\seebelow@; // \expos
772+
constexpr bool @\exposid{is-default-initializable}@ = @\seebelow@; // \expos
773773

774774
template<class T>
775775
concept @\deflibconcept{default_initializable}@ = @\libconcept{constructible_from}@<T> &&

source/containers.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11043,9 +11043,9 @@
1104311043
class span;
1104411044

1104511045
template<class ElementType, size_t Extent>
11046-
inline constexpr bool ranges::enable_view<span<ElementType, Extent>> = true;
11046+
constexpr bool ranges::enable_view<span<ElementType, Extent>> = true;
1104711047
template<class ElementType, size_t Extent>
11048-
inline constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true;
11048+
constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true;
1104911049

1105011050
// \ref{span.objectrep}, views of object representation
1105111051
template<class ElementType, size_t Extent>

source/diagnostics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,9 @@
812812

813813
// \ref{syserr}, system error support
814814
template<class T>
815-
inline constexpr bool is_error_code_enum_v = is_error_code_enum<T>::value;
815+
constexpr bool is_error_code_enum_v = is_error_code_enum<T>::value;
816816
template<class T>
817-
inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<T>::value;
817+
constexpr bool is_error_condition_enum_v = is_error_condition_enum<T>::value;
818818
}
819819
\end{codeblock}
820820

source/future.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@
13681368
\begin{codeblock}
13691369
namespace std {
13701370
template<class T> struct is_pod;
1371-
template<class T> inline constexpr bool is_pod_v = is_pod<T>::value;
1371+
template<class T> constexpr bool is_pod_v = is_pod<T>::value;
13721372
}
13731373
\end{codeblock}
13741374

source/iterators.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
// \ref{iterator.concept.sizedsentinel}, concept \libconcept{sized_sentinel_for}
112112
template<class S, class I>
113-
inline constexpr bool disable_sized_sentinel_for = false;
113+
constexpr bool disable_sized_sentinel_for = false;
114114

115115
template<class S, class I>
116116
concept sized_sentinel_for = @\seebelow@;
@@ -316,8 +316,8 @@
316316

317317
template<class Iterator1, class Iterator2>
318318
requires (!@\libconcept{sized_sentinel_for}@<Iterator1, Iterator2>)
319-
inline constexpr bool disable_sized_sentinel_for<reverse_iterator<Iterator1>,
320-
reverse_iterator<Iterator2>> = true;
319+
constexpr bool disable_sized_sentinel_for<reverse_iterator<Iterator1>,
320+
reverse_iterator<Iterator2>> = true;
321321

322322
// \ref{insert.iterators}, insert iterators
323323
template<class Container> class back_insert_iterator;
@@ -1315,10 +1315,10 @@
13151315

13161316
\begin{codeblock}
13171317
template<class T>
1318-
inline constexpr bool @\exposid{is-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
1318+
constexpr bool @\exposid{is-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
13191319

13201320
template<class T>
1321-
inline constexpr bool @\exposid{is-signed-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
1321+
constexpr bool @\exposid{is-signed-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
13221322

13231323
template<class I>
13241324
concept @\deflibconcept{weakly_incrementable}@ =
@@ -1657,7 +1657,7 @@
16571657
\indexlibraryglobal{disable_sized_sentinel_for}%
16581658
\begin{itemdecl}
16591659
template<class S, class I>
1660-
inline constexpr bool disable_sized_sentinel_for = false;
1660+
constexpr bool disable_sized_sentinel_for = false;
16611661
\end{itemdecl}
16621662

16631663
\begin{itemdescr}

source/numerics.tex

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10950,33 +10950,33 @@
1095010950
\indexheader{numbers}%
1095110951
\begin{codeblock}
1095210952
namespace std::numbers {
10953-
template<class T> inline constexpr T e_v = @\unspec@;
10954-
template<class T> inline constexpr T log2e_v = @\unspec@;
10955-
template<class T> inline constexpr T log10e_v = @\unspec@;
10956-
template<class T> inline constexpr T pi_v = @\unspec@;
10957-
template<class T> inline constexpr T inv_pi_v = @\unspec@;
10958-
template<class T> inline constexpr T inv_sqrtpi_v = @\unspec@;
10959-
template<class T> inline constexpr T ln2_v = @\unspec@;
10960-
template<class T> inline constexpr T ln10_v = @\unspec@;
10961-
template<class T> inline constexpr T sqrt2_v = @\unspec@;
10962-
template<class T> inline constexpr T sqrt3_v = @\unspec@;
10963-
template<class T> inline constexpr T inv_sqrt3_v = @\unspec@;
10964-
template<class T> inline constexpr T egamma_v = @\unspec@;
10965-
template<class T> inline constexpr T phi_v = @\unspec@;
10966-
10967-
template<@\libconcept{floating_point}@ T> inline constexpr T e_v<T> = @\seebelow@;
10968-
template<@\libconcept{floating_point}@ T> inline constexpr T log2e_v<T> = @\seebelow@;
10969-
template<@\libconcept{floating_point}@ T> inline constexpr T log10e_v<T> = @\seebelow@;
10970-
template<@\libconcept{floating_point}@ T> inline constexpr T pi_v<T> = @\seebelow@;
10971-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_pi_v<T> = @\seebelow@;
10972-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_sqrtpi_v<T> = @\seebelow@;
10973-
template<@\libconcept{floating_point}@ T> inline constexpr T ln2_v<T> = @\seebelow@;
10974-
template<@\libconcept{floating_point}@ T> inline constexpr T ln10_v<T> = @\seebelow@;
10975-
template<@\libconcept{floating_point}@ T> inline constexpr T sqrt2_v<T> = @\seebelow@;
10976-
template<@\libconcept{floating_point}@ T> inline constexpr T sqrt3_v<T> = @\seebelow@;
10977-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_sqrt3_v<T> = @\seebelow@;
10978-
template<@\libconcept{floating_point}@ T> inline constexpr T egamma_v<T> = @\seebelow@;
10979-
template<@\libconcept{floating_point}@ T> inline constexpr T phi_v<T> = @\seebelow@;
10953+
template<class T> constexpr T e_v = @\unspec@;
10954+
template<class T> constexpr T log2e_v = @\unspec@;
10955+
template<class T> constexpr T log10e_v = @\unspec@;
10956+
template<class T> constexpr T pi_v = @\unspec@;
10957+
template<class T> constexpr T inv_pi_v = @\unspec@;
10958+
template<class T> constexpr T inv_sqrtpi_v = @\unspec@;
10959+
template<class T> constexpr T ln2_v = @\unspec@;
10960+
template<class T> constexpr T ln10_v = @\unspec@;
10961+
template<class T> constexpr T sqrt2_v = @\unspec@;
10962+
template<class T> constexpr T sqrt3_v = @\unspec@;
10963+
template<class T> constexpr T inv_sqrt3_v = @\unspec@;
10964+
template<class T> constexpr T egamma_v = @\unspec@;
10965+
template<class T> constexpr T phi_v = @\unspec@;
10966+
10967+
template<@\libconcept{floating_point}@ T> constexpr T e_v<T> = @\seebelow@;
10968+
template<@\libconcept{floating_point}@ T> constexpr T log2e_v<T> = @\seebelow@;
10969+
template<@\libconcept{floating_point}@ T> constexpr T log10e_v<T> = @\seebelow@;
10970+
template<@\libconcept{floating_point}@ T> constexpr T pi_v<T> = @\seebelow@;
10971+
template<@\libconcept{floating_point}@ T> constexpr T inv_pi_v<T> = @\seebelow@;
10972+
template<@\libconcept{floating_point}@ T> constexpr T inv_sqrtpi_v<T> = @\seebelow@;
10973+
template<@\libconcept{floating_point}@ T> constexpr T ln2_v<T> = @\seebelow@;
10974+
template<@\libconcept{floating_point}@ T> constexpr T ln10_v<T> = @\seebelow@;
10975+
template<@\libconcept{floating_point}@ T> constexpr T sqrt2_v<T> = @\seebelow@;
10976+
template<@\libconcept{floating_point}@ T> constexpr T sqrt3_v<T> = @\seebelow@;
10977+
template<@\libconcept{floating_point}@ T> constexpr T inv_sqrt3_v<T> = @\seebelow@;
10978+
template<@\libconcept{floating_point}@ T> constexpr T egamma_v<T> = @\seebelow@;
10979+
template<@\libconcept{floating_point}@ T> constexpr T phi_v<T> = @\seebelow@;
1098010980

1098110981
inline constexpr double e = e_v<double>;
1098210982
inline constexpr double log2e = log2e_v<double>;

source/ranges.tex

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
concept range = @\seebelow@;
5555

5656
template<class T>
57-
inline constexpr bool enable_borrowed_range = false;
57+
constexpr bool enable_borrowed_range = false;
5858

5959
template<class T>
6060
concept borrowed_range = @\seebelow@;
@@ -76,14 +76,14 @@
7676

7777
// \ref{range.sized}, sized ranges
7878
template<class>
79-
inline constexpr bool disable_sized_range = false;
79+
constexpr bool disable_sized_range = false;
8080

8181
template<class T>
8282
concept sized_range = @\seebelow@;
8383

8484
// \ref{range.view}, views
8585
template<class T>
86-
inline constexpr bool enable_view = @\seebelow@;
86+
constexpr bool enable_view = @\seebelow@;
8787

8888
struct view_base {};
8989

@@ -128,7 +128,7 @@
128128
class subrange;
129129

130130
template<class I, class S, subrange_kind K>
131-
inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;
131+
constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;
132132

133133
// \ref{range.dangling}, dangling iterator handling
134134
struct dangling;
@@ -145,11 +145,11 @@
145145
class empty_view;
146146

147147
template<class T>
148-
inline constexpr bool enable_borrowed_range<empty_view<T>> = true;
148+
constexpr bool enable_borrowed_range<empty_view<T>> = true;
149149

150150
namespace views {
151151
template<class T>
152-
inline constexpr empty_view<T> @\libmember{empty}{views}@{};
152+
constexpr empty_view<T> @\libmember{empty}{views}@{};
153153
}
154154

155155
// \ref{range.single}, single view
@@ -168,7 +168,7 @@
168168
class iota_view;
169169

170170
template<class W, class Bound>
171-
inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;
171+
constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true;
172172

173173
namespace views { inline constexpr @\unspec@ iota = @\unspec@; }
174174

@@ -196,7 +196,7 @@
196196
class ref_view;
197197

198198
template<class T>
199-
inline constexpr bool enable_borrowed_range<ref_view<T>> = true;
199+
constexpr bool enable_borrowed_range<ref_view<T>> = true;
200200

201201
// \ref{range.owning.view}, owning view
202202
template<range R>
@@ -226,7 +226,7 @@
226226
template<@\libconcept{view}@> class take_view;
227227

228228
template<class T>
229-
inline constexpr bool enable_borrowed_range<take_view<T>> = enable_borrowed_range<T>;
229+
constexpr bool enable_borrowed_range<take_view<T>> = enable_borrowed_range<T>;
230230

231231
namespace views { inline constexpr @\unspec@ take = @\unspec@; }
232232

@@ -243,7 +243,7 @@
243243
class drop_view;
244244

245245
template<class T>
246-
inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>;
246+
constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>;
247247

248248
namespace views { inline constexpr @\unspec@ drop = @\unspec@; }
249249

@@ -254,8 +254,7 @@
254254
class drop_while_view;
255255

256256
template<class T, class Pred>
257-
inline constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> =
258-
enable_borrowed_range<T>;
257+
constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> = enable_borrowed_range<T>;
259258

260259
namespace views { inline constexpr @\unspec@ drop_while = @\unspec@; }
261260

@@ -296,7 +295,7 @@
296295
class common_view;
297296

298297
template<class T>
299-
inline constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>;
298+
constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>;
300299

301300
namespace views { inline constexpr @\unspec@ common = @\unspec@; }
302301

@@ -306,7 +305,7 @@
306305
class reverse_view;
307306

308307
template<class T>
309-
inline constexpr bool enable_borrowed_range<reverse_view<T>> = enable_borrowed_range<T>;
308+
constexpr bool enable_borrowed_range<reverse_view<T>> = enable_borrowed_range<T>;
310309

311310
namespace views { inline constexpr @\unspec@ reverse = @\unspec@; }
312311

@@ -316,7 +315,7 @@
316315
class elements_view;
317316

318317
template<class T, size_t N>
319-
inline constexpr bool enable_borrowed_range<elements_view<T, N>> = enable_borrowed_range<T>;
318+
constexpr bool enable_borrowed_range<elements_view<T, N>> = enable_borrowed_range<T>;
320319

321320
template<class R>
322321
using @\libglobal{keys_view}@ = elements_view<R, 0>;
@@ -325,7 +324,7 @@
325324

326325
namespace views {
327326
template<size_t N>
328-
inline constexpr @\unspec@ elements = @\unspec@;
327+
constexpr @\unspec@ elements = @\unspec@;
329328
inline constexpr auto @\libmember{keys}{views}@ = elements<0>;
330329
inline constexpr auto @\libmember{values}{views}@ = elements<1>;
331330
}
@@ -1143,7 +1142,7 @@
11431142
\indexlibraryglobal{enable_borrowed_range}%
11441143
\begin{itemdecl}
11451144
template<class>
1146-
inline constexpr bool enable_borrowed_range = false;
1145+
constexpr bool enable_borrowed_range = false;
11471146
\end{itemdecl}
11481147

11491148
\begin{itemdescr}
@@ -1210,7 +1209,7 @@
12101209
\indexlibraryglobal{disable_sized_range}%
12111210
\begin{itemdecl}
12121211
template<class>
1213-
inline constexpr bool disable_sized_range = false;
1212+
constexpr bool disable_sized_range = false;
12141213
\end{itemdecl}
12151214

12161215
\begin{itemdescr}
@@ -1302,9 +1301,9 @@
13021301
\indexlibraryglobal{enable_view}%
13031302
\begin{itemdecl}
13041303
template<class T>
1305-
inline constexpr bool @\exposidnc{is-derived-from-view-interface}@ = @\seebelownc@; // \expos
1304+
constexpr bool @\exposidnc{is-derived-from-view-interface}@ = @\seebelownc@; // \expos
13061305
template<class T>
1307-
inline constexpr bool enable_view =
1306+
constexpr bool enable_view =
13081307
@\libconcept{derived_from}@<T, view_base> || @\exposid{is-derived-from-view-interface}@<T>;
13091308
\end{itemdecl}
13101309

source/strings.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4057,9 +4057,9 @@
40574057
class basic_string_view;
40584058

40594059
template<class charT, class traits>
4060-
inline constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
4060+
constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
40614061
template<class charT, class traits>
4062-
inline constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true;
4062+
constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true;
40634063

40644064
// \ref{string.view.comparison}, non-member comparison functions
40654065
template<class charT, class traits>

source/time.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@
8888
// \ref{time.traits}, customization traits
8989
template<class Rep> struct treat_as_floating_point;
9090
template<class Rep>
91-
inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value;
91+
constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value;
9292

9393
template<class Rep> struct duration_values;
9494

9595
template<class T> struct is_clock;
96-
template<class T> inline constexpr bool is_clock_v = is_clock<T>::value;
96+
template<class T> constexpr bool is_clock_v = is_clock<T>::value;
9797

9898
// \ref{time.duration.nonmember}, \tcode{duration} arithmetic
9999
template<class Rep1, class Period1, class Rep2, class Period2>

0 commit comments

Comments
 (0)