Comment

Comment by UncleMeat

???

You can absolutely write a type like this.

    class Foo {
     public:
      Foo() {}  // never initialized x
      int x; 
    }
And then using it like this

    Foo f;
    bar(foo.x);  // oops
"But my types are well designed" is the usual response to "why the heck does the language allow you to quietly expose yourself to UB in this way?"
parent UncleMeat 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton