A minor syntax request

Daniel van Vugt daniel.van.vugt at canonical.com
Tue Apr 16 10:06:15 UTC 2013

Can we please start to allow the style:

     const T x
     const T &x
     T *x

I believe it is probably the most common syntax in general industry use, 
and also one that many of us are used to and most comfortable with. 
Other arguments for this syntax are:

   1. It's part of the C/C++ language definition that &/* belongs to the 
variable and not the type...
        T x, *y = &x;
   2. It feels more natural for many readers to think "constant T" when 
reading "const T", than when reading "T const".
   3. It's more obvious that your variable is a variable if you say:
        const T *a;
        a = b;
      However writing it this way, it's less obvious that a is not 
constant itself:
        T const* a;
        a = b;

Do we really need to be so strict about using the Mir convention:

     T const x
     T cons& x
     T* x


More information about the Mir-devel mailing list