C++ Logo

std-proposals

Advanced search

Re: [std-proposals] ^^operator [was: Re: New draft proposal: Add "%s" (two-digit truncated-integer seconds) as a std::format conversion specifier for std::chrono time types.]

From: David Brown <david_at_[hidden]>
Date: Thu, 4 May 2023 13:25:39 +0200
On 04/05/2023 10:53, Jonathan Wakely via Std-Proposals wrote:

>
> I think it would be nice to be able to make your own operators (as you
> can in some languages), using combinations of existing punctuation and
> Unicode characters. People would be able to make vector classes and
> write "a × b" and "a · b", or set classes with "a ∩ b" and "a ∪ b".
> (Library authors would be encouraged to provide alternative text forms,
> in the manner of "bitand".) And in particular, it would mean that
> things like "**" for exponentiation could be added as a library feature
> rather than a language change.
>
> All that's needed are massive changes to the way the language is
> parsed...
>
>
> Reflection.
>

Will we ever see reflection and something like Herb Sutter's
"metaclasses" in C++ ? There are so many potential use-cases - but of
course so many awkward and complicated issues needed to add them to the
language.

Maybe we'll just have to wait for Cpp2 !

Received on 2023-05-04 11:25:47