Skip to content

[LWG motion 6 2024-06] P2985R0 A type trait for detecting virtual base classes #7108

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

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions source/meta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
// \ref{meta.rel}, type relations
template<class T, class U> struct is_same;
template<class Base, class Derived> struct is_base_of;
template<class Base, class Derived> struct is_virtual_base_of;
template<class From, class To> struct is_convertible;
template<class From, class To> struct is_nothrow_convertible;
template<class T, class U> struct is_layout_compatible;
Expand Down Expand Up @@ -548,6 +549,8 @@
constexpr bool @\libglobal{is_same_v}@ = is_same<T, U>::value;
template<class Base, class Derived>
constexpr bool @\libglobal{is_base_of_v}@ = is_base_of<Base, Derived>::value;
template<class Base, class Derived>
constexpr bool @\libglobal{is_virtual_base_of_v}@ = is_virtual_base_of<Base, Derived>::value;
template<class From, class To>
constexpr bool @\libglobal{is_convertible_v}@ = is_convertible<From, To>::value;
template<class From, class To>
Expand Down Expand Up @@ -1463,15 +1466,31 @@
without regard to cv-qualifiers &
If \tcode{Base} and
\tcode{Derived} are non-union class types and are
not (possibly cv-qualified versions of) the same type,
not (possibly cv-qualified versions of) the same type,
\tcode{Derived} shall be a complete
type.
\begin{tailnote}
Base classes that are private, protected, or ambiguous
Base classes that are private, protected, or ambiguous
are, nonetheless, base classes.
\end{tailnote}
\\ \rowsep

\indexlibraryglobal{is_virtual_base_of}%
\tcode{template<class Base, class Derived>}\br
\tcode{struct is_virtual_base_of;} &
\tcode{Base} is a virtual base class of \tcode{Derived}\iref{class.mi}
without regard to cv-qualifiers. &
If \tcode{Base} and
\tcode{Derived} are non-union class types,
\tcode{Derived} shall be a complete type.
\begin{note}
Virtual base classes that are private, protected, or ambiguous
are, nonetheless, virtual base classes.
\end{note}
\begin{tailnote}
A class is never a virtual base class of itself.
\end{tailnote} \\ \rowsep

\indexlibraryglobal{is_convertible}%
\tcode{template<class From, class To>}\br
\tcode{struct is_convertible;} &
Expand All @@ -1486,7 +1505,7 @@
the conversion, as defined by \tcode{is_convertible},
is known not to throw any exceptions\iref{expr.unary.noexcept} &
\tcode{From} and \tcode{To} shall be complete types,
\cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep
\cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep

\indexlibraryglobal{is_layout_compatible}%
\tcode{template<class T, class U>}\br
Expand Down
1 change: 1 addition & 0 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@
#define @\defnlibxname{cpp_lib_is_pointer_interconvertible}@ 201907L // freestanding, also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_is_scoped_enum}@ 202011L // freestanding, also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_is_swappable}@ 201603L // freestanding, also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_is_virtual_base_of}@ 202406L // also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_is_within_lifetime}@ 202306L // also in \libheader{type_traits}
#define @\defnlibxname{cpp_lib_jthread}@ 201911L // also in \libheader{stop_token}, \libheader{thread}
#define @\defnlibxname{cpp_lib_latch}@ 201907L // also in \libheader{latch}
Expand Down
Loading