|
|
Thorsten Froehlich <tho### [at] trfde> wrote:
> Please be advised that your statement is incorrect. 'register' is not
> defined to be a "no-op" at all. See for example ISO/IEC 14882:2003 (or 1998
> if you like, either way it is the ISO C++ standard) section 7.1.1 number 3.
> Specifically, it is a hint to the compiler that "the object so declared will
> be heavily used".
I meant "it's in practice a no-op". I didn't mean it's "officially a
deprecated keyword".
Of course in theory it gives a hint to the compiler, and in really old
C compilers it really had an effect, but AFAIK compilers have ignored it
completely for over a decade. They will use their own internal optimization
algorithms regardless of that keyword.
It's the same as with the 'inline' keyword with regard to optimization:
When optimizing, compilers usually completely ignore that keyword. It doesn't
have any effect on the output. (But of course 'inline' has other meaningful
uses which makes it a non-no-op.)
--
- Warp
Post a reply to this message
|
|