[Mesa-dev] [PATCH 1/2] i965/fs: Use a const reference in fs_reg::equals instead of a pointer.

Eric Anholt eric at anholt.net
Mon May 14 11:02:08 PDT 2012


On Fri, 11 May 2012 14:25:45 -0700, Ian Romanick <idr at freedesktop.org> wrote:
> On 05/10/2012 04:10 PM, Kenneth Graunke wrote:
> > This lets you omit some ampersands and is more idiomatic C++.  Using
> > const also marks the function as not altering either register (which
> > was obvious, but nice to enforce).
> 
> I'm increasingly *not* a fan of this sort of weird infix notation. 
> Infix notation really only "reads" if operator symbols are used.  I'd 
> much rather have a friend function.  Instead of
> 
>      if (foo.equals(bar)) {
>      }
> 
> I'd much rather see
> 
>      if (equal(foo, bar)) {
>      }
> 
> But that's just this programmers opinion.
> 
> Since you're keeping the style of the code as it existed,
> 
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

As the author of the equals function, I totally agree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120514/cd245ca5/attachment.pgp>


More information about the mesa-dev mailing list