Thread with 9 posts
jump to expanded postceterum autem censeo c++ esse delendam https://consteval.ca/2024/07/03/initialization/
βͺi can get my head around constructors in c. i can get my head around constructors in rust. but i am not willing to touch them in c++ unless i am forced toβ¬
[if you use a different type of parentheses] temporaries bound to references do not have their lifetimes extended
aaaAAAAAAAAA a A A Aa A A A A aοΌ‘οΌ‘οΌ‘οΌ‘οΌ‘οΌ‘οΌ‘οΌ‘ο½ο½ο½ο½ο½ο½
ο½γο½ο½ο½ο½γο½γο½ο½ο½ο½ο½γο½ο½ο½ο½ ο½ο½γο½ο½ο½ο½γο½ο½ο½ ο½ο½ο½ ππππππππ
@hikari initialization is arguably the messiest part of C++. In practice though it's not so bad, I rarely got bitten by an initialization problem and when they happen it's usually quite obvious.
@hikari i used c++ for years but i think the moment it started to truly spook me was when i found out about the "explicit" keyword and why it exists
@mcc implicit conversions? π
@hikari Implicit conversions :(
And this turns out to go nuclear with Qt because all types have a Typename(QObject *) constructor, which in that context is the equivalent of Typename(Any type here)
@mcc aaaAAAAAaAAAaaaa
@hikari β¦and so this isn't a problem with *base* qt, because all base qt constructors are declared with explicit
but the first thing you do when you start writing qt is you subclass existing qt classes and create your own MyQtClass(QObject *) {} constructors
so if you don't know about the `explicit` convention and why the qt base libraries do it, you have just placed a landmine under your chair