Skip to content

Commit 895634a

Browse files
committed
[lib] Drop 'inline' from 'inline constexpr' variable templates.
Since CWG2387, constexpr variable templates have external linkage.
1 parent b96fcaf commit 895634a

File tree

9 files changed

+62
-62
lines changed

9 files changed

+62
-62
lines changed

β€Žsource/concepts.texβ€Ž

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

776776
\begin{itemdecl}
777777
template<class T>
778-
inline constexpr bool @\exposid{is-default-initializable}@ = @\seebelow@; // \expos
778+
constexpr bool @\exposid{is-default-initializable}@ = @\seebelow@; // \expos
779779

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

β€Žsource/diagnostics.texβ€Ž

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

817817
// \ref{syserr}, system error support
818818
template<class T>
819-
inline constexpr bool is_error_code_enum_v = is_error_code_enum<T>::value;
819+
constexpr bool is_error_code_enum_v = is_error_code_enum<T>::value;
820820
template<class T>
821-
inline constexpr bool is_error_condition_enum_v = is_error_condition_enum<T>::value;
821+
constexpr bool is_error_condition_enum_v = is_error_condition_enum<T>::value;
822822
}
823823
\end{codeblock}
824824

β€Ž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
template<size_t Len, size_t Align = @\exposid{default-alignment}@> // \seebelow
13731373
struct aligned_storage;
13741374
template<size_t Len, size_t Align = @\exposid{default-alignment}@> // \seebelow

β€Žsource/iterators.texβ€Ž

Lines changed: 5 additions & 5 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; // freestanding
113+
constexpr bool disable_sized_sentinel_for = false; // freestanding
114114

115115
template<class S, class I>
116116
concept sized_sentinel_for = @\seebelow@; // freestanding
@@ -317,7 +317,7 @@
317317

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

323323
// \ref{insert.iterators}, insert iterators
@@ -1366,10 +1366,10 @@
13661366

13671367
\begin{codeblock}
13681368
template<class T>
1369-
inline constexpr bool @\exposid{is-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
1369+
constexpr bool @\exposid{is-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // \expos
13701370

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

13741374
template<class I>
13751375
concept @\deflibconcept{weakly_incrementable}@ =
@@ -1700,7 +1700,7 @@
17001700
\indexlibraryglobal{disable_sized_sentinel_for}%
17011701
\begin{itemdecl}
17021702
template<class S, class I>
1703-
inline constexpr bool disable_sized_sentinel_for = false;
1703+
constexpr bool disable_sized_sentinel_for = false;
17041704
\end{itemdecl}
17051705

17061706
\begin{itemdescr}

β€Žsource/numerics.texβ€Ž

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10301,33 +10301,33 @@
1030110301
\indexheader{numbers}%
1030210302
\begin{codeblock}
1030310303
namespace std::numbers {
10304-
template<class T> inline constexpr T e_v = @\unspec@;
10305-
template<class T> inline constexpr T log2e_v = @\unspec@;
10306-
template<class T> inline constexpr T log10e_v = @\unspec@;
10307-
template<class T> inline constexpr T pi_v = @\unspec@;
10308-
template<class T> inline constexpr T inv_pi_v = @\unspec@;
10309-
template<class T> inline constexpr T inv_sqrtpi_v = @\unspec@;
10310-
template<class T> inline constexpr T ln2_v = @\unspec@;
10311-
template<class T> inline constexpr T ln10_v = @\unspec@;
10312-
template<class T> inline constexpr T sqrt2_v = @\unspec@;
10313-
template<class T> inline constexpr T sqrt3_v = @\unspec@;
10314-
template<class T> inline constexpr T inv_sqrt3_v = @\unspec@;
10315-
template<class T> inline constexpr T egamma_v = @\unspec@;
10316-
template<class T> inline constexpr T phi_v = @\unspec@;
10317-
10318-
template<@\libconcept{floating_point}@ T> inline constexpr T e_v<T> = @\seebelow@;
10319-
template<@\libconcept{floating_point}@ T> inline constexpr T log2e_v<T> = @\seebelow@;
10320-
template<@\libconcept{floating_point}@ T> inline constexpr T log10e_v<T> = @\seebelow@;
10321-
template<@\libconcept{floating_point}@ T> inline constexpr T pi_v<T> = @\seebelow@;
10322-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_pi_v<T> = @\seebelow@;
10323-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_sqrtpi_v<T> = @\seebelow@;
10324-
template<@\libconcept{floating_point}@ T> inline constexpr T ln2_v<T> = @\seebelow@;
10325-
template<@\libconcept{floating_point}@ T> inline constexpr T ln10_v<T> = @\seebelow@;
10326-
template<@\libconcept{floating_point}@ T> inline constexpr T sqrt2_v<T> = @\seebelow@;
10327-
template<@\libconcept{floating_point}@ T> inline constexpr T sqrt3_v<T> = @\seebelow@;
10328-
template<@\libconcept{floating_point}@ T> inline constexpr T inv_sqrt3_v<T> = @\seebelow@;
10329-
template<@\libconcept{floating_point}@ T> inline constexpr T egamma_v<T> = @\seebelow@;
10330-
template<@\libconcept{floating_point}@ T> inline constexpr T phi_v<T> = @\seebelow@;
10304+
template<class T> constexpr T e_v = @\unspec@;
10305+
template<class T> constexpr T log2e_v = @\unspec@;
10306+
template<class T> constexpr T log10e_v = @\unspec@;
10307+
template<class T> constexpr T pi_v = @\unspec@;
10308+
template<class T> constexpr T inv_pi_v = @\unspec@;
10309+
template<class T> constexpr T inv_sqrtpi_v = @\unspec@;
10310+
template<class T> constexpr T ln2_v = @\unspec@;
10311+
template<class T> constexpr T ln10_v = @\unspec@;
10312+
template<class T> constexpr T sqrt2_v = @\unspec@;
10313+
template<class T> constexpr T sqrt3_v = @\unspec@;
10314+
template<class T> constexpr T inv_sqrt3_v = @\unspec@;
10315+
template<class T> constexpr T egamma_v = @\unspec@;
10316+
template<class T> constexpr T phi_v = @\unspec@;
10317+
10318+
template<@\libconcept{floating_point}@ T> constexpr T e_v<T> = @\seebelow@;
10319+
template<@\libconcept{floating_point}@ T> constexpr T log2e_v<T> = @\seebelow@;
10320+
template<@\libconcept{floating_point}@ T> constexpr T log10e_v<T> = @\seebelow@;
10321+
template<@\libconcept{floating_point}@ T> constexpr T pi_v<T> = @\seebelow@;
10322+
template<@\libconcept{floating_point}@ T> constexpr T inv_pi_v<T> = @\seebelow@;
10323+
template<@\libconcept{floating_point}@ T> constexpr T inv_sqrtpi_v<T> = @\seebelow@;
10324+
template<@\libconcept{floating_point}@ T> constexpr T ln2_v<T> = @\seebelow@;
10325+
template<@\libconcept{floating_point}@ T> constexpr T ln10_v<T> = @\seebelow@;
10326+
template<@\libconcept{floating_point}@ T> constexpr T sqrt2_v<T> = @\seebelow@;
10327+
template<@\libconcept{floating_point}@ T> constexpr T sqrt3_v<T> = @\seebelow@;
10328+
template<@\libconcept{floating_point}@ T> constexpr T inv_sqrt3_v<T> = @\seebelow@;
10329+
template<@\libconcept{floating_point}@ T> constexpr T egamma_v<T> = @\seebelow@;
10330+
template<@\libconcept{floating_point}@ T> constexpr T phi_v<T> = @\seebelow@;
1033110331

1033210332
inline constexpr double e = e_v<double>;
1033310333
inline constexpr double log2e = log2e_v<double>;

β€Žsource/ranges.texβ€Ž

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
concept range = @\seebelow@; // freestanding
5656

5757
template<class T>
58-
inline constexpr bool enable_borrowed_range = false; // freestanding
58+
constexpr bool enable_borrowed_range = false; // freestanding
5959

6060
template<class T>
6161
concept borrowed_range = @\seebelow@; // freestanding
@@ -83,14 +83,14 @@
8383

8484
// \ref{range.sized}, sized ranges
8585
template<class>
86-
inline constexpr bool disable_sized_range = false; // freestanding
86+
constexpr bool disable_sized_range = false; // freestanding
8787

8888
template<class T>
8989
concept sized_range = @\seebelow@; // freestanding
9090

9191
// \ref{range.view}, views
9292
template<class T>
93-
inline constexpr bool enable_view = @\seebelow@; // freestanding
93+
constexpr bool enable_view = @\seebelow@; // freestanding
9494

9595
struct view_base {}; // freestanding
9696

@@ -138,7 +138,7 @@
138138
class subrange; // freestanding
139139

140140
template<class I, class S, subrange_kind K>
141-
inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; // freestanding
141+
constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; // freestanding
142142

143143
template<size_t N, class I, class S, subrange_kind K>
144144
requires ((N == 0 && @\libconcept{copyable}@<I>) || N == 1)
@@ -187,7 +187,7 @@
187187

188188
namespace views {
189189
template<class T>
190-
inline constexpr empty_view<T> @\libmember{empty}{views}@{}; // freestanding
190+
constexpr empty_view<T> @\libmember{empty}{views}@{}; // freestanding
191191
}
192192

193193
// \ref{range.single}, single view
@@ -206,7 +206,7 @@
206206
class iota_view; // freestanding
207207

208208
template<class W, class Bound>
209-
inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true; // freestanding
209+
constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true; // freestanding
210210

211211
namespace views { inline constexpr @\unspecnc@ iota = @\unspecnc@; } // freestanding
212212

@@ -248,7 +248,7 @@
248248
class ref_view; // freestanding
249249

250250
template<class T>
251-
inline constexpr bool enable_borrowed_range<ref_view<T>> = true; // freestanding
251+
constexpr bool enable_borrowed_range<ref_view<T>> = true; // freestanding
252252

253253
// \ref{range.owning.view}, owning view
254254
template<@\libconcept{range}@ R>
@@ -290,7 +290,7 @@
290290
template<@\libconcept{view}@> class take_view; // freestanding
291291

292292
template<class T>
293-
inline constexpr bool enable_borrowed_range<take_view<T>> = // freestanding
293+
constexpr bool enable_borrowed_range<take_view<T>> = // freestanding
294294
enable_borrowed_range<T>;
295295

296296
namespace views { inline constexpr @\unspecnc@ take = @\unspecnc@; } // freestanding
@@ -308,7 +308,7 @@
308308
class drop_view; // freestanding
309309

310310
template<class T>
311-
inline constexpr bool enable_borrowed_range<drop_view<T>> = // freestanding
311+
constexpr bool enable_borrowed_range<drop_view<T>> = // freestanding
312312
enable_borrowed_range<T>;
313313

314314
namespace views { inline constexpr @\unspecnc@ drop = @\unspecnc@; } // freestanding
@@ -320,7 +320,7 @@
320320
class drop_while_view; // freestanding
321321

322322
template<class T, class Pred>
323-
inline constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> = // freestanding
323+
constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> = // freestanding
324324
enable_borrowed_range<T>;
325325

326326
namespace views { inline constexpr @\unspecnc@ drop_while = @\unspecnc@; } // freestanding
@@ -374,7 +374,7 @@
374374
class common_view; // freestanding
375375

376376
template<class T>
377-
inline constexpr bool enable_borrowed_range<common_view<T>> = // freestanding
377+
constexpr bool enable_borrowed_range<common_view<T>> = // freestanding
378378
enable_borrowed_range<T>;
379379

380380
namespace views { inline constexpr @\unspecnc@ common = @\unspecnc@; } // freestanding
@@ -405,7 +405,7 @@
405405
class as_const_view; // freestanding
406406

407407
template<class T>
408-
inline constexpr bool enable_borrowed_range<as_const_view<T>> = // freestanding
408+
constexpr bool enable_borrowed_range<as_const_view<T>> = // freestanding
409409
enable_borrowed_range<T>;
410410

411411
namespace views { inline constexpr @\unspecnc@ as_const = @\unspecnc@; } // freestanding
@@ -416,7 +416,7 @@
416416
class elements_view; // freestanding
417417

418418
template<class T, size_t N>
419-
inline constexpr bool enable_borrowed_range<elements_view<T, N>> = // freestanding
419+
constexpr bool enable_borrowed_range<elements_view<T, N>> = // freestanding
420420
enable_borrowed_range<T>;
421421

422422
template<class R>
@@ -426,7 +426,7 @@
426426

427427
namespace views {
428428
template<size_t N>
429-
inline constexpr @\unspecnc@ elements = @\unspecnc@; // freestanding
429+
constexpr @\unspecnc@ elements = @\unspecnc@; // freestanding
430430
inline constexpr auto @\libmember{keys}{views}@ = elements<0>; // freestanding
431431
inline constexpr auto @\libmember{values}{views}@ = elements<1>; // freestanding
432432
}
@@ -1319,7 +1319,7 @@
13191319
\indexlibraryglobal{enable_borrowed_range}%
13201320
\begin{itemdecl}
13211321
template<class>
1322-
inline constexpr bool enable_borrowed_range = false;
1322+
constexpr bool enable_borrowed_range = false;
13231323
\end{itemdecl}
13241324

13251325
\begin{itemdescr}
@@ -1386,7 +1386,7 @@
13861386
\indexlibraryglobal{disable_sized_range}%
13871387
\begin{itemdecl}
13881388
template<class>
1389-
inline constexpr bool disable_sized_range = false;
1389+
constexpr bool disable_sized_range = false;
13901390
\end{itemdecl}
13911391

13921392
\begin{itemdescr}
@@ -1478,9 +1478,9 @@
14781478
\indexlibraryglobal{enable_view}%
14791479
\begin{itemdecl}
14801480
template<class T>
1481-
inline constexpr bool @\exposidnc{is-derived-from-view-interface}@ = @\seebelownc@; // \expos
1481+
constexpr bool @\exposidnc{is-derived-from-view-interface}@ = @\seebelownc@; // \expos
14821482
template<class T>
1483-
inline constexpr bool enable_view =
1483+
constexpr bool enable_view =
14841484
@\libconcept{derived_from}@<T, view_base> || @\exposid{is-derived-from-view-interface}@<T>;
14851485
\end{itemdecl}
14861486

β€Žsource/strings.texβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@
541541
class basic_string_view;
542542

543543
template<class charT, class traits>
544-
inline constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
544+
constexpr bool ranges::enable_view<basic_string_view<charT, traits>> = true;
545545
template<class charT, class traits>
546-
inline constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true;
546+
constexpr bool ranges::enable_borrowed_range<basic_string_view<charT, traits>> = true;
547547

548548
// \ref{string.view.comparison}, non-member comparison functions
549549
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>

β€Žsource/utilities.texβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@
207207
struct in_place_type_t {
208208
explicit in_place_type_t() = default;
209209
};
210-
template<class T> inline constexpr in_place_type_t<T> in_place_type{};
210+
template<class T> constexpr in_place_type_t<T> in_place_type{};
211211

212212
template<size_t I>
213213
struct in_place_index_t {
214214
explicit in_place_index_t() = default;
215215
};
216-
template<size_t I> inline constexpr in_place_index_t<I> in_place_index{};
216+
template<size_t I> constexpr in_place_index_t<I> in_place_index{};
217217
}
218218
\end{codeblock}
219219

@@ -1584,7 +1584,7 @@
15841584

15851585
// \ref{tuple.helper}, tuple helper classes
15861586
template<class T>
1587-
inline constexpr size_t @\libglobal{tuple_size_v}@ = tuple_size<T>::value;
1587+
constexpr size_t @\libglobal{tuple_size_v}@ = tuple_size<T>::value;
15881588
}
15891589
\end{codeblock}
15901590

@@ -4857,7 +4857,7 @@
48574857
template<class T> struct variant_size; // \notdef
48584858
template<class T> struct variant_size<const T>;
48594859
template<class T>
4860-
inline constexpr size_t @\libglobal{variant_size_v}@ = variant_size<T>::value;
4860+
constexpr size_t @\libglobal{variant_size_v}@ = variant_size<T>::value;
48614861

48624862
template<class... Types>
48634863
struct variant_size<variant<Types...>>;

0 commit comments

Comments
 (0)