Point3 default constructor

Issue #271 invalid
Jing Dong created an issue

Changing Point3's default constructor behavior to uninitialized causes tons of hidden bugs in my code. We are following convention that default constructor creates (0,0,0) for years, and changing this behavior gives no warning in compile time at all, so it's really hard to figure them all.

I propose change the default constructor behavior to (0,0,0). This does not conflict with make Point3 an alise to Vector3. If @dellaert you think this make sense I will start working on that.

Comments (3)

  1. Frank Dellaert

    Actually, this was a carefully thought-out design decision. The longer-term intent is to be able to just typedef Point3 to Vector3, which does not initialize. I tracked down all constructor uses by having a temporary constructor that throws (or static asserts false).

  2. Jing Dong reporter

    OK the debug method makes sense to me, I have found most of the hidden bugs and I will try to find the rest..

  3. Log in to comment