C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow chaining of -> for normal pointers

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Sat, 7 Jan 2023 20:59:52 +0100
On 07/01/2023 19:52, Frederick Virchanza Gotham via Std-Proposals wrote:
>
> When I first started wondering about the implications of this core
> language change, I first thought that it might break old code that
> relies on SFINAE, but I tried writing a template function with
> "std::enable_if" and I don't actually think that this change to the
> core language would break any SFINAE achieved with "std::enable_if".


This would break:

> template <typename T, typename Enable = void>
> constexpr bool x = false;
>
> template <typename T>
> constexpr bool x <T, std::void_t<decltype(std::declval<T>()->size())>> = true;
>
> static_assert(!x<std::string **>);




My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2023-01-07 19:59:55