Boost logo

Boost :

Subject: Re: [boost] [qvm] Terseness of syntax etc.
From: Emil Dotchevski (emil_at_[hidden])
Date: 2015-12-08 16:13:32


On Tue, Dec 8, 2015 at 11:07 AM, Francois Duranleau <
xiao.bai.xiong_at_[hidden]> wrote:

> I totally agree with all you said. In addition, I would shy away from the
> X,
> Y, Z (and combinations) accessors using capital letters in order to
> avoid clashes with macros
> (I recently hit a clash with a struct member I named B0 and a macro in
> some Android system header; there is no B0 here, but I just want to
> illustrate the protential problem).
>

Swizzling is rendered nearly useless if it requires elaborate syntax or
long names. Currently, if you want the Z and X swapped, you'd use (v,ZYX).

I've considered using lower case but that doesn't work well in the case of
(v,x) since it's quite likely that it'll clash with a local x.

Clashes with macros are possible, but FWIW I've been using this library for
years now and never had a clash (all these names are defined in a separate
header, you don't have to include it if you don't need swizzling.)

Thanks,
Emil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk