K
KPB
I have an O'Reilly Safari Online subscription. I decided to check out
this book(C++ Templates) and am half way through it.
For those of you who read this one, I don't know what you thought about
section 1.4 (Some remarks about Programming Style) but I thought it was
weird at first.
You know? Writing an init statement like this:
int const N = 100;
instead of like this (which I've always done)
const int N = 100;
I have to say though, the style outlined in the book has really grown on
me. It really makes sense when you throw a reference token or pointer
token in there. Just read it from right to left
char const* const p = 0;
I know from reading this right to left it's a "constant pointer" to a
"constant character".
Using this way as I always have done:
const char* const p = 0;
I always had to think about it for a second.
I see the authors' points about this. Did any of you are do you still
think it's *weird*?
Just curious.
KPB
this book(C++ Templates) and am half way through it.
For those of you who read this one, I don't know what you thought about
section 1.4 (Some remarks about Programming Style) but I thought it was
weird at first.
You know? Writing an init statement like this:
int const N = 100;
instead of like this (which I've always done)
const int N = 100;
I have to say though, the style outlined in the book has really grown on
me. It really makes sense when you throw a reference token or pointer
token in there. Just read it from right to left
char const* const p = 0;
I know from reading this right to left it's a "constant pointer" to a
"constant character".
Using this way as I always have done:
const char* const p = 0;
I always had to think about it for a second.
I see the authors' points about this. Did any of you are do you still
think it's *weird*?
Just curious.
KPB