C++ Logo

std-proposals

Advanced search

Re: Proposal: Pattern Matching: Auto-dereference

From: Viktor Kireev <vitech-job_at_[hidden]>
Date: Thu, 06 Feb 2020 12:18:30 +0300
On Monday, 3 February 2020 12:47:23 MSK Михаил Найденов via Std-Proposals
wrote:
> Hello, I present a (draft) proposal, which argues auto-dereference is
> preferred over the dereference pattern in current Pattern Matching.

I think this is a useful and convenient feature.

I have two questions:
1. Who will decide which types can be implicitly dereferenced and which
cannot?
2. What about std::weak_ptr?
std::weak_ptr<Rect> r;
inspect(r) {
    ???
}

-- 
Victor Kireev

Received on 2020-02-06 03:21:10