Standard way to supply hints to branches

Manu turkeyman at gmail.com
Tue Aug 27 05:27:40 UTC 2024


On Mon, 26 Aug 2024 at 17:16, Walter Bright via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 8/24/2024 9:47 AM, Manu wrote:
> > C++ is way ahead on this... they added attributes to the language years
> back,
> > and they defined [[likely]] and [[unlikely]] post-fix on control
> statements.
> > It's really convenient, it reads well, and it's easy to retrofit without
> > disturbing the code.
> > That's the de-facto now, and we should follow it.
>
> It's unattractive.
>
> I provided two alternate means to accomplish the same thing elsewhere in
> this
> thread.
>
>
> https://www.digitalmars.com/d/archives/digitalmars/D/Standard_way_to_supply_hints_to_branches_375697.html#N375717
>

"Unattractive"? ... seriously?
Your suggestions were to quite seriously molest the code, reordering,
adding extra scopes, inverting logic, nonsense statements like `do {}
while(0)`, using labels and goto's which doesn't marry well with general
control flow and RAII type things... sorry; but "unattractive"? That might
be the most bizarre thing I've ever heard you say! ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20240827/97290605/attachment.htm>


More information about the Digitalmars-d mailing list