Forgive me, but I don't see it your way.
Reasoning about the type upon seeing the definition or declaration is the
unlikely case to occur.

The likely case we should be reasoning about is recalling the type upon
seeing a usage.

In that case either you remember what VPOS is, or you open the file with
the declaration, or you use your editor's support to tell you.
In cases like this, the _declaration_ is 'auto', not 'vsize'. And now it's
not useful to you.
IF code intelligence or a header show you more, you can piece it together
in our head,
if not, you're making poor use of time.
And the saving of not typing vsize twice is just not there.
That's a one second thing once in a blue moon, whereas every time you see
VPOS you'll have to know what type it is.
(ok, maybe half the time, but it's still a lot more than the churn expected
on the type it's declared as, come on)

L

(btw, why is VPOS defined as -1? this seems like a weird name for a default
value, wouldn't something more descriptive
of "default" or "unset" be more appropriate here?)


On Tue, Feb 27, 2024 at 5:42 AM Werner LEMBERG <w...@gnu.org> wrote:

>
> >> OK, but don't repeat the type.
> >>
> >>      inline constexpr auto VPOS = vsize (-1);
> >>
> >
> > Well. To that, yes and no. I read it better in the original way,
> > [...]
>
> I'm on Dan's side here: Using 'auto' tells me that the right-hand
> side's type is exactly the one on the left-hand side, and I can stop
> thinking about it immediately.
>
>
>     Werner
>


-- 
Luca Fascione

Reply via email to