End Google Ads 201810 - BS.net 01 --> For years I've written

const Blah& b = GetMyBlah();
I was taught to read these right to left - ie a reference to a Blah which is const.

A colleague has pointed out that this is in fact incorrect as the const key word is left associative but most compilers allow it (gcc, intel, clang and VC in my case). So it should be written

Blah const& b = GetMyBlah();
When read right to left it's a reference to a const Blah - same thing.

He pointed me to the parashift c++ faq http://www.parashift.com/c++-faq-lite/[^] which was changed recently to put the const between the type and the reference.

Obviously pointers are difference as both the pointer and the object pointed two (or both) can be const while a reference is always const.