revenant is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
revenant @revenant

en.cppreference.com/w/cpp/expe

finally, a new C++ pointer type that is literally just a regular pointer that is referred to differently for no reason. i'm in heaven

ยท Web ยท 5 ยท 14
@er1n @revenant I'm going to assume someone wanted to write some generic code that mutated unique_ptr and other smart pointers and was like "BUT WAIT WHY CAN'T I DO THIS ON T*"

in other news I'm gonna go beat the shit out of the C++ Library Working Group because evidently they can waste time on this but not standardize fucking Vector2 / Vector3
@revenant @er1n come to think of it, maybe I don't want them standarding those. it'd probably end up with some bizarro data layout that someone once used in an obscure GPU

@ninjawedding @revenant @er1n b-but wait, what ever was wrong with good 'ol std::valarray<*is mobbed off stage*

@gdkar @revenant @er1n I still have no idea what valarray is for tbh

like is it something that's meant to be compatible with e.g. LAPACK

@revenant and this is in *addition* to both optionals and references? I love it

@revenant "hey guys. under our new 'experimental' apis we have this radical idea... it's a reference, to another part of memory, that doesn't make any assumptions about ownership,"

@revenant
"but is it nullable"
"you can bet your return statement it's nullable"

@revenant is there some communication of intent this actually helps with?

@sl2c @revenant i think the intent it communicates is "this is just like a c pointer, but i'm a very smart c++ developer who used it on purpose, not a veteran c developer still coding c in c++"

or something like that

@00dani @sl2c @revenant Basically this, yes.

โ€œHi, yes, I know this C++ codebase is almost all references, unique_ptr<>, and shared_ptr<>, but this raw pointer really needs to be a raw pointer and isn't a mistake or something that needs to be fixed up to match the coding styleโ€

(Disclaimer: I have actually wanted observing_ptr<> for pretty much this reason)

"It is intended as a near drop-in replacement for raw pointer types, with the advantage that, as a vocabulary type, it indicates its intended use"

finally, a way to know what the intended use of a pointer is. thank god 2018 will be the year where C++ code can effectively communicate the intent of a variable by simply declaring it as an instance of `std::non_owning_const_piss_shit_hell_ptr<int>` instead of `int*`

anyway this seems like a good a time as any to remind you that if you use smart pointers, you're a cop

@revenant

I would assume, from the name and description, that it is intended as a weak pointer should C++ ever get a garbage collector. So it's almost certainly not that.

I must say that while I feel your pain, as someone who works on static analysis tools for C++, I do appreciate the standards body's contribution to my job security.

i'm actually upset about std::observing_ptr. it's somehow the exact opposite of syntactic sugar. std::shared_pointer and std::unique_pointer, etc. were already unsightly enough and now for some reason the name of a raw pointer type needs to have even more letters in it, for some reason. this is the kind of thing a language would be given as punishment if it were capable of dying and going to hell

everyone on earth: "rev, it's 1 am. how about eating food and going to sleep instead of having a heart attack about a programming language feature you're never going to use or even encounter in your life"

me:

me: anyway, fuck THIS part of the STL too, and don't even fucking get me sta-

@revenant "if i wanted life pointers i wouldve kept reading c++ documentation!!! wait shit fuck

@revenant
I wrote off C++ when I read about nullptr. They added a new type and new keyword rather than relax the casting rules for (void*)0.

Actually, that's a lie. I wrote off C++ long before that.

@revenant every 4 or 5 years i (a person who has occasionally written c++ but never actually learned enough c++ to understand anything at all) catch a little windnow into the current state of c++ and it's a glimpse into some kind of weird postmodern satirical hellscape full of strange glittering mechanisms assembled entirely out of razor blades and crank ontological obsessiveness.

@brennen that sounds like a more enjoyable experience than the reality of it

@revenant leave me a few of my cherished illusions

@aras @brennen @revenant @Tak
C++ is all about figuring what not to use. Like a puzzle to keep us entertained while working

@brennen @revenant I last "really" used C++ years ago and it was in a "C with some nice C++ bits" style.

I look at modern C++ and wonder just what the fuck happened.

@revenant I think I might actually like this. Help Iโ€™m a C++ dev now arenโ€™t I