From 57667d0a42abec7568603eb688d9bf838617dbc7 Mon Sep 17 00:00:00 2001 From: Carl Lei Date: Thu, 2 Apr 2020 17:09:07 +0800 Subject: [PATCH] allow T* -> T const* but not Derived* -> Base* --- ptr-iter-const-conv.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ptr-iter-const-conv.cc diff --git a/ptr-iter-const-conv.cc b/ptr-iter-const-conv.cc new file mode 100644 index 0000000..259c883 --- /dev/null +++ b/ptr-iter-const-conv.cc @@ -0,0 +1,10 @@ +#include + +static_assert(std::is_convertible_v); + +struct B {}; +struct D : B {}; + +static_assert(std::is_convertible_v); +static_assert(!std::is_convertible_v); +static_assert(std::is_convertible_v);