Archive

Archive for October, 2010

No implicit conversion from ‘T **’ to ‘const T **’

October 21st, 2010 No comments

For a type T, C++ allows an implicit conversion from T* to const T*. This is safe and you most likely used it hundreds of times before (think method calls with const pointer parameters). But if you try it with a double pointer (e.g. implicitly converting T** to const T**) it will fail. gcc for example will tell you something in the lines of:

error: invalid conversion from 'Test**' to 'const Test**'

Have you ever wandered why this is unsafe and wrong and so reported as a compile time error? Read more…

Yoda conditions

October 20th, 2010 1 comment

I never liked, agreed with or used these much until I found them as a rule in a “coding practices” document lately, document that I’m supposed to be following. Luckily, it’s just an optional rule…
So what is a Yoda condition? It’s a practice of reversing the normal order of the operands in an equality condition and placing the constant (or, more generally, something that is not an LHS expression) on the left of the operator; instead of writing for example Read more…

The Myths of Innovation

October 14th, 2010 No comments

True, not a free book, but I really appreciate the author, his books, presentations and his style.

A great book, The Myths of Innovation, is now out in paperback with 4 new chapters – It’s gotten fantastic reviews for being fun, inspiring and a great read. You have to check it out if you work …with ideas or hope to someday.

The Myths of Innovation

The Myths of Innovation, Scott Berkun