Live data from Hacker News

C constructs that still don't work in C++

lospino.so

181–182 of 182 posts

Re: C constructs that still don't work in C++

#181
post #157

C++ the good parts is essentially C. If C had the concept of traits and generics or something like them like Rust there’d be no need for C++ and its ideas of mediocre inheritance and macros (templates).

Tbf, I'd say Rust's concepts of Trait Objects and Generics are better implementations (in general) of C++'s inheritance and templates, respectively, rather than entirely different things. I'd also add constexpr/const blocks to good ideas to add, or else generics/templates will be abused (yet again).

There is no inherit in Rust. If you choose to try and do OOP horror Rust makes this fairly painful

Re: C constructs that still don't work in C++

#182
post #181

Earlier quoted context omitted.

Tbf, I'd say Rust's concepts of Trait Objects and Generics are better implementations (in general) of C++'s inheritance and templates, respectively, rather than entirely different things. I'd also add constexpr/const blocks to good ideas to add, or else generics/templates will be abused (yet again).

There is no inherit in Rust. If you choose to try and do OOP horror Rust makes this fairly painful

I know. I mentioned C++ inheritance because it's its default dynamic dispatch mechanism that I'm aware of.
Post reply on HN