Skip to content

Commit f481d00

Browse files
burblebeetkoeppe
authored andcommitted
P2833R2 Freestanding Library: inout expected span
1 parent 97b46ac commit f481d00

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

source/containers.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18223,13 +18223,14 @@
1822318223
\begin{codeblock}
1822418224
#include <initializer_list> // see \ref{initializer.list.syn}
1822518225

18226+
// mostly freestanding
1822618227
namespace std {
1822718228
// constants
1822818229
inline constexpr size_t @\libglobal{dynamic_extent}@ = numeric_limits<size_t>::max();
1822918230

1823018231
// \ref{views.span}, class template \tcode{span}
1823118232
template<class ElementType, size_t Extent = dynamic_extent>
18232-
class span;
18233+
class span; // partially freestanding
1823318234

1823418235
template<class ElementType, size_t Extent>
1823518236
constexpr bool ranges::@\libspec{enable_view}{span}@<span<ElementType, Extent>> = true;
@@ -19037,6 +19038,7 @@
1903719038

1903819039
\indexheader{mdspan}%
1903919040
\begin{codeblock}
19041+
// all freestanding
1904019042
namespace std {
1904119043
// \ref{mdspan.extents}, class template \tcode{extents}
1904219044
template<class IndexType, size_t... Extents>

source/lib-intro.tex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,13 +1525,16 @@
15251525
\ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
15261526
\ref{optional} & Optional objects & \tcode{<optional>} \\ \rowsep
15271527
\ref{variant} & Variants & \tcode{<variant>} \\ \rowsep
1528+
\ref{expected} & Expected objects & \tcode{<expected>} \\ \rowsep
15281529
\ref{function.objects} & Function objects & \tcode{<functional>} \\ \rowsep
15291530
\ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
15301531
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
15311532
\ref{string.view} & String view classes & \tcode{<string_view>} \\ \rowsep
15321533
\ref{string.classes} & String classes & \tcode{<string>} \\ \rowsep
15331534
\ref{c.strings} & Null-terminated sequence utilities & \tcode{<cstring>}, \tcode{<cwchar>} \\ \rowsep
15341535
\ref{array} & Class template \tcode{array} & \tcode{<array>} \\ \rowsep
1536+
\ref{views.contiguous} & Contiguous access & \tcode{<span>} \\ \rowsep
1537+
\ref{views.multidim} & Multidimensional access & \tcode{<mdspan>} \\ \rowsep
15351538
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
15361539
\ref{ranges} & Ranges library & \tcode{<ranges>} \\ \rowsep
15371540
\ref{algorithms} & Algorithms library & \tcode{<algorithm>}, \tcode{<numeric>} \\ \rowsep

source/memory.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,19 +570,19 @@
570570

571571
// \ref{out.ptr.t}, class template \tcode{out_ptr_t}
572572
template<class Smart, class Pointer, class... Args>
573-
class out_ptr_t;
573+
class out_ptr_t; // freestanding
574574

575575
// \ref{out.ptr}, function template \tcode{out_ptr}
576576
template<class Pointer = void, class Smart, class... Args>
577-
auto out_ptr(Smart& s, Args&&... args);
577+
auto out_ptr(Smart& s, Args&&... args); // freestanding
578578

579579
// \ref{inout.ptr.t}, class template \tcode{inout_ptr_t}
580580
template<class Smart, class Pointer, class... Args>
581-
class inout_ptr_t;
581+
class inout_ptr_t; // freestanding
582582

583583
// \ref{inout.ptr}, function template \tcode{inout_ptr}
584584
template<class Pointer = void, class Smart, class... Args>
585-
auto inout_ptr(Smart& s, Args&&... args);
585+
auto inout_ptr(Smart& s, Args&&... args); // freestanding
586586
}
587587
\end{codeblock}
588588

source/support.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,11 @@
647647
#define @\defnlibxname{cpp_lib_freestanding_cwchar}@ 202306L // freestanding, also in \libheader{cwchar}
648648
#define @\defnlibxname{cpp_lib_freestanding_errc}@ 202306L
649649
// freestanding, also in \libheader{cerrno}, \libheader{system_error}
650+
#define @\defnlibxname{cpp_lib_freestanding_expected}@ 202311L // freestanding, also in \libheader{expected}
650651
#define @\defnlibxname{cpp_lib_freestanding_feature_test_macros}@ 202306L // freestanding
651652
#define @\defnlibxname{cpp_lib_freestanding_functional}@ 202306L // freestanding, also in \libheader{functional}
652653
#define @\defnlibxname{cpp_lib_freestanding_iterator}@ 202306L // freestanding, also in \libheader{iterator}
654+
#define @\defnlibxname{cpp_lib_freestanding_mdspan}@ 202311L // freestanding, also in \libheader{mdspan}
653655
#define @\defnlibxname{cpp_lib_freestanding_memory}@ 202306L // freestanding, also in \libheader{memory}
654656
#define @\defnlibxname{cpp_lib_freestanding_operator_new}@ @\seebelow@ // freestanding, also in \libheader{new}
655657
#define @\defnlibxname{cpp_lib_freestanding_optional}@ 202311L // freestanding, also in \libheader{optional}
@@ -716,7 +718,7 @@
716718
#define @\defnlibxname{cpp_lib_not_fn}@ 202306L // freestanding, also in \libheader{functional}
717719
#define @\defnlibxname{cpp_lib_null_iterators}@ 201304L // freestanding, also in \libheader{iterator}
718720
#define @\defnlibxname{cpp_lib_optional}@ 202110L // also in \libheader{optional}
719-
#define @\defnlibxname{cpp_lib_out_ptr}@ 202106L // also in \libheader{memory}
721+
#define @\defnlibxname{cpp_lib_out_ptr}@ 202311L // freestanding, also in \libheader{memory}
720722
#define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric}
721723
#define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource}
722724
#define @\defnlibxname{cpp_lib_print}@ 202207L // also in \libheader{print}, \libheader{ostream}
@@ -761,7 +763,7 @@
761763
#define @\defnlibxname{cpp_lib_smart_ptr_for_overwrite}@ 202002L // also in \libheader{memory}
762764
#define @\defnlibxname{cpp_lib_smart_ptr_owner_equality}@ 202306L // also in \libheader{memory}
763765
#define @\defnlibxname{cpp_lib_source_location}@ 201907L // freestanding, also in \libheader{source_location}
764-
#define @\defnlibxname{cpp_lib_span}@ 202311L // also in \libheader{span}
766+
#define @\defnlibxname{cpp_lib_span}@ 202311L // freestanding, also in \libheader{span}
765767
#define @\defnlibxname{cpp_lib_span_initializer_list}@ 202311L // also in \libheader{span}
766768
#define @\defnlibxname{cpp_lib_spanstream}@ 202106L // also in \libheader{spanstream}
767769
#define @\defnlibxname{cpp_lib_ssize}@ 201902L // freestanding, also in \libheader{iterator}

source/utilities.tex

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6995,6 +6995,7 @@
69956995
\indexlibraryglobal{unexpect_t}%
69966996
\indexlibraryglobal{unexpect}%
69976997
\begin{codeblock}
6998+
// mostly freestanding
69986999
namespace std {
69997000
// \ref{expected.unexpected}, class template \tcode{unexpected}
70007001
template<class E> class unexpected;
@@ -7012,10 +7013,10 @@
70127013
inline constexpr unexpect_t unexpect{};
70137014

70147015
// \ref{expected.expected}, class template \tcode{expected}
7015-
template<class T, class E> class expected;
7016+
template<class T, class E> class expected; // partially freestanding
70167017

70177018
// \ref{expected.void}, partial specialization of \tcode{expected} for \tcode{void} types
7018-
template<class T, class E> requires is_void_v<T> class expected<T, E>;
7019+
template<class T, class E> requires is_void_v<T> class expected<T, E>; // partially freestanding
70197020
}
70207021
\end{codeblock}
70217022

@@ -7398,10 +7399,10 @@
73987399
constexpr T&& operator*() && noexcept;
73997400
constexpr explicit operator bool() const noexcept;
74007401
constexpr bool has_value() const noexcept;
7401-
constexpr const T& value() const &;
7402-
constexpr T& value() &;
7403-
constexpr const T&& value() const &&;
7404-
constexpr T&& value() &&;
7402+
constexpr const T& value() const &; // freestanding-deleted
7403+
constexpr T& value() &; // freestanding-deleted
7404+
constexpr const T&& value() const &&; // freestanding-deleted
7405+
constexpr T&& value() &&; // freestanding-deleted
74057406
constexpr const E& error() const & noexcept;
74067407
constexpr E& error() & noexcept;
74077408
constexpr const E&& error() const && noexcept;
@@ -8792,8 +8793,8 @@
87928793
constexpr explicit operator bool() const noexcept;
87938794
constexpr bool has_value() const noexcept;
87948795
constexpr void operator*() const noexcept;
8795-
constexpr void value() const &;
8796-
constexpr void value() &&;
8796+
constexpr void value() const &; // freestanding-deleted
8797+
constexpr void value() &&; // freestanding-deleted
87978798
constexpr const E& error() const & noexcept;
87988799
constexpr E& error() & noexcept;
87998800
constexpr const E&& error() const && noexcept;

0 commit comments

Comments
 (0)