C++ Logo

std-proposals

Advanced search

Re: Variadic function template equivalents for operator overloading

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Thu, 6 May 2021 10:39:25 +0200
czw., 6 maj 2021 o 06:31 Thiago Macieira via Std-Proposals
<std-proposals_at_[hidden]> napisaƂ(a):
>
> On Tuesday, 4 May 2021 10:39:06 PDT Avi Kivity via Std-Proposals wrote:
> > Since they adopted the proposal, it appears they agree that the
> > function-call syntax is more natural than chaining.
>
> auto dooms the chaining.
>
> auto result1 = format(fmtstring, a, b, c);
>
> auto result2 = format(fmtstring) << a << b << c;
>
> What is the type of result2?
>

This could require "operator auto".

btw recently I discovered that we already have this operator in C++,
but only for one thing: C arrays (value decay).
And as one goal of C++ is that user types should have the same
capabilities as built in then they should be able to deacy too.
Of course if used too much then it could be problematic, but if done
correctly then it would be more beneficial.
As arrays behavior is bad because they fit more C than C++, but user
types from the start will fit C++ more.


> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DPG Cloud Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2021-05-06 03:39:35