C++ Logo


Advanced search

Re: [std-proposals] Return type deduction

From: Zhihao Yuan <zy_at_[hidden]>
Date: Thu, 10 Mar 2022 08:38:41 +0000
On Wednesday, March 9th, 2022 at 10:40 PM, Jason McKesson via Std-Proposals <std-proposals_at_[hidden]> wrote:


> No, if we're going to do that, it should be something that's a part of
> the return statement itself, not something in another file somewhere.

Then maybe

  auto f(int *p) {
    if (cond)
      return {nullptr}; // currently outlawed from deducing anything
      return p;

Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.

Received on 2022-03-10 08:38:46