Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pointer.conversion] Reorder overloads of to_address #2814

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6559,10 +6559,10 @@
template<class T> struct pointer_traits<T*>;

// \ref{pointer.conversion}, pointer conversion
template<class Ptr>
auto to_address(const Ptr& p) noexcept;
template<class T>
constexpr T* to_address(T* p) noexcept;
template<class Ptr>
auto to_address(const Ptr& p) noexcept;

// \ref{util.dynamic.safety}, pointer safety
enum class pointer_safety { relaxed, preferred, strict };
Expand Down Expand Up @@ -7137,28 +7137,28 @@

\indexlibrary{\idxcode{to_address}}%
\begin{itemdecl}
template<class Ptr> auto to_address(const Ptr& p) noexcept;
template<class T> constexpr T* to_address(T* p) noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\returns
\tcode{pointer_traits<Ptr>::to_address(p)} if that expression is well-formed
(see \ref{pointer.traits.optmem}),
otherwise \tcode{to_address(p.operator->())}.
\requires \tcode{T} is not a function type. Otherwise the program is ill-formed.

\pnum
\returns \tcode{p}.
\end{itemdescr}

\indexlibrary{\idxcode{to_address}}%
\begin{itemdecl}
template<class T> constexpr T* to_address(T* p) noexcept;
template<class Ptr> auto to_address(const Ptr& p) noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\requires \tcode{T} is not a function type. Otherwise the program is ill-formed.

\pnum
\returns \tcode{p}.
\returns
\tcode{pointer_traits<Ptr>::to_address(p)} if that expression is well-formed
(see \ref{pointer.traits.optmem}),
otherwise \tcode{to_address(p.operator->())}.
\end{itemdescr}

\rSec2[util.dynamic.safety]{Pointer safety}
Expand Down