Skip to content

Commit

Permalink
P2833R2 Freestanding Library: inout expected span
Browse files Browse the repository at this point in the history
  • Loading branch information
burblebee committed Nov 16, 2023
1 parent ecbeb5a commit ee55735
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
4 changes: 3 additions & 1 deletion source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18218,13 +18218,14 @@

\indexheader{span}%
\begin{codeblock}
// mostly freestanding
namespace std {
// constants
inline constexpr size_t @\libglobal{dynamic_extent}@ = numeric_limits<size_t>::max();

// \ref{views.span}, class template \tcode{span}
template<class ElementType, size_t Extent = dynamic_extent>
class span;
class span; // partially freestanding

template<class ElementType, size_t Extent>
constexpr bool ranges::@\libspec{enable_view}{span}@<span<ElementType, Extent>> = true;
Expand Down Expand Up @@ -18988,6 +18989,7 @@

\indexheader{mdspan}%
\begin{codeblock}
// all freestanding
namespace std {
// \ref{mdspan.extents}, class template \tcode{extents}
template<class IndexType, size_t... Extents>
Expand Down
3 changes: 3 additions & 0 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,14 @@
\ref{ratio} & Compile-time rational arithmetic & \tcode{<ratio>} \\ \rowsep
\ref{utility} & Utility components & \tcode{<utility>} \\ \rowsep
\ref{tuple} & Tuples & \tcode{<tuple>} \\ \rowsep
\ref{expected} & Expected objects & \tcode{<expected>} \\ \rowsep
\ref{function.objects} & Function objects & \tcode{<functional>} \\ \rowsep
\ref{charconv} & Primitive numeric conversions & \tcode{<charconv>} \\ \rowsep
\ref{bit} & Bit manipulation & \tcode{<bit>} \\ \rowsep
\ref{string.classes} & String classes & \tcode{<string>} \\ \rowsep
\ref{c.strings} & Null-terminated sequence utilities & \tcode{<cstring>}, \tcode{<cwchar>} \\ \rowsep
\ref{views.contiguous} & Contiguous access & \tcode{<span>} \\ \rowsep
\ref{views.multidim} & Multidimensional access & \tcode{<mdspan>} \\ \rowsep
\ref{iterators} & Iterators library & \tcode{<iterator>} \\ \rowsep
\ref{ranges} & Ranges library & \tcode{<ranges>} \\ \rowsep
\ref{c.math} & Mathematical functions for floating-point types & \tcode{<cmath>} \\ \rowsep
Expand Down
8 changes: 4 additions & 4 deletions source/memory.tex
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,19 @@

// \ref{out.ptr.t}, class template \tcode{out_ptr_t}
template<class Smart, class Pointer, class... Args>
class out_ptr_t;
class out_ptr_t; // freestanding

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

// \ref{inout.ptr.t}, class template \tcode{inout_ptr_t}
template<class Smart, class Pointer, class... Args>
class inout_ptr_t;
class inout_ptr_t; // freestanding

// \ref{inout.ptr}, function template \tcode{inout_ptr}
template<class Pointer = void, class Smart, class... Args>
auto inout_ptr(Smart& s, Args&&... args);
auto inout_ptr(Smart& s, Args&&... args); // freestanding
}
\end{codeblock}

Expand Down
6 changes: 4 additions & 2 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,11 @@
#define @\defnlibxname{cpp_lib_freestanding_cwchar}@ 202306L // freestanding, also in \libheader{cwchar}
#define @\defnlibxname{cpp_lib_freestanding_errc}@ 202306L
// freestanding, also in \libheader{cerrno}, \libheader{system_error}
#define @\defnlibxname{cpp_lib_freestanding_expected}@ 202311L // freestanding, also in \libheader{expected}
#define @\defnlibxname{cpp_lib_freestanding_feature_test_macros}@ 202306L // freestanding
#define @\defnlibxname{cpp_lib_freestanding_functional}@ 202306L // freestanding, also in \libheader{functional}
#define @\defnlibxname{cpp_lib_freestanding_iterator}@ 202306L // freestanding, also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_freestanding_mdspan}@ 202311L // freestanding, also in \libheader{mdspan}
#define @\defnlibxname{cpp_lib_freestanding_memory}@ 202306L // freestanding, also in \libheader{memory}
#define @\defnlibxname{cpp_lib_freestanding_operator_new}@ @\seebelow@ // freestanding, also in \libheader{new}
#define @\defnlibxname{cpp_lib_freestanding_ranges}@ 202306L // freestanding, also in \libheader{ranges}
Expand Down Expand Up @@ -708,7 +710,7 @@
#define @\defnlibxname{cpp_lib_not_fn}@ 202306L // freestanding, also in \libheader{functional}
#define @\defnlibxname{cpp_lib_null_iterators}@ 201304L // freestanding, also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_optional}@ 202110L // also in \libheader{optional}
#define @\defnlibxname{cpp_lib_out_ptr}@ 202106L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_out_ptr}@ 202311L // freestanding, also in \libheader{memory}
#define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric}
#define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource}
#define @\defnlibxname{cpp_lib_print}@ 202207L // also in \libheader{print}, \libheader{ostream}
Expand Down Expand Up @@ -752,7 +754,7 @@
#define @\defnlibxname{cpp_lib_smart_ptr_for_overwrite}@ 202002L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_smart_ptr_owner_equality}@ 202306L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_source_location}@ 201907L // freestanding, also in \libheader{source_location}
#define @\defnlibxname{cpp_lib_span}@ 202002L // also in \libheader{span}
#define @\defnlibxname{cpp_lib_span}@ 202311L // freestanding, also in \libheader{span}
#define @\defnlibxname{cpp_lib_spanstream}@ 202106L // also in \libheader{spanstream}
#define @\defnlibxname{cpp_lib_ssize}@ 201902L // freestanding, also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_sstream_from_string_view}@ 202306L // also in \libheader{sstream}
Expand Down
17 changes: 9 additions & 8 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6940,6 +6940,7 @@
\indexlibraryglobal{unexpect_t}%
\indexlibraryglobal{unexpect}%
\begin{codeblock}
// mostly freestanding
namespace std {
// \ref{expected.unexpected}, class template \tcode{unexpected}
template<class E> class unexpected;
Expand All @@ -6957,10 +6958,10 @@
inline constexpr unexpect_t unexpect{};

// \ref{expected.expected}, class template \tcode{expected}
template<class T, class E> class expected;
template<class T, class E> class expected; // partially freestanding

// \ref{expected.void}, partial specialization of \tcode{expected} for \tcode{void} types
template<class T, class E> requires is_void_v<T> class expected<T, E>;
template<class T, class E> requires is_void_v<T> class expected<T, E>; // partially freestanding
}
\end{codeblock}

Expand Down Expand Up @@ -7343,10 +7344,10 @@
constexpr T&& operator*() && noexcept;
constexpr explicit operator bool() const noexcept;
constexpr bool has_value() const noexcept;
constexpr const T& value() const &;
constexpr T& value() &;
constexpr const T&& value() const &&;
constexpr T&& value() &&;
constexpr const T& value() const &; // freestanding-deleted
constexpr T& value() &; // freestanding-deleted
constexpr const T&& value() const &&; // freestanding-deleted
constexpr T&& value() &&; // freestanding-deleted
constexpr const E& error() const & noexcept;
constexpr E& error() & noexcept;
constexpr const E&& error() const && noexcept;
Expand Down Expand Up @@ -8737,8 +8738,8 @@
constexpr explicit operator bool() const noexcept;
constexpr bool has_value() const noexcept;
constexpr void operator*() const noexcept;
constexpr void value() const &;
constexpr void value() &&;
constexpr void value() const &; // freestanding-deleted
constexpr void value() &&; // freestanding-deleted
constexpr const E& error() const & noexcept;
constexpr E& error() & noexcept;
constexpr const E&& error() const && noexcept;
Expand Down

0 comments on commit ee55735

Please sign in to comment.