awavauatush @ninjawedding
Guess what I've been doing today
· Web · 8 · 17
uh I think I missed a std::decay_t<> in there somewhere
@calvin would you believe pound-define didn't even occur to me as a possibility

@ninjawedding I mean, I stick to C99 when I do C shenanigans, and especially avoid C++, so...

maybe some brief explanation would help

small brain: C++: call bar with foo's arguments
big brain: genericize over return and argument types
bright brain: genericize over types and arity
exploding brain: type deduction
cosmic brain: use Ruby

@ninjawedding What's even better is that that is only one of the *many* ways to do aliasing in Ruby

@ninjawedding Pretty much, you can go from lexical alias over method-copying with alias_method over method_missing magic up to refinements and/or forwardable stuff

@ninjawedding fuck, for a moment I had a glimmer of hope that the C++ standards committee had done something I'd be interested in. Alas... 😩

@jon_valdes they may have - C++17 can be a lot more sensible than this :P

@ninjawedding
I'd guess something along the lines of

auto auto(auto auto) {
return auto(auto);
}

@aeonofdiscord lol that also did not occur to me at all
@aeonofdiscord like seriously :P academically I know that a function has a type but actually really grokking that is going to destroy my world

@ninjawedding honestly std::function + auto + lambdas basically made it a whole new language for me, it's so much easier to express stuff than it used to be

@aeonofdiscord yeah totally!

I still find myself writing out huge amounts of rococo crap (see meme) and then later on someone tells me "uhh why not just do [something way shorter] and then I'm like 😶​ and my world goes :kaboom:​ and I need to audit everything

but I guess that's learning

@ninjawedding @aeonofdiscord honestly "why not just do *way simpler thing*" is like, any time I talk about coding, ever

@ninjawedding Guh, selected another subthread and missed this one where that was the first suggestion...

@Tak yeah it’s kind of amazing how many simple solutions I didn’t even consider :P

when my head gets in one place, it tends to stay there heh

@ninjawedding I was with you up to alias_method. What the heck is that?

@sixohsix me being cheeky and throwing in Ruby :P

others have pointed out that auto foo = bar; is valid and I think that is a much better cosmic brain
@Efi hmm, I remember running all of these through g++ 7.2 - maybe I missed a type-programming thing somewhere?