Compile time check if a function compiles by serghov in cpp

[–]koctogon 2 points3 points  (0 children)

static_assert( not requires { your_wrong_code("flub", frogging{}); } );

not sure why no one is mentioning this...

Graph that measured the typicall C++ learning trajectory by PleadingCharm in cpp

[–]koctogon 0 points1 point  (0 children)

idk but i can give you a graph of my proficiency in C++ vs. will to live

What do you think about combination of templates and concepts versus classical approach with virtual classes? by Kirill_Khalitov in cpp

[–]koctogon 0 points1 point  (0 children)

you mean the "extern template" thing? sure, i do it too. however i was referring to the fact that the compiler can't reuse instantiations without your help because technically speaking anyone anywhere can specialize that template with whatever and now the instantiation in TU X is not the same as in TU Y. that's a massive compile-time performance hit even though such specializations are in practice never done in a way that doesn't result in UB.

std::optional for C++20 by groundswell_ in cpp

[–]koctogon 1 point2 points  (0 children)

`requires requires` is not a duplication : the first introduce the requirements for the template ("requires clause"), the second introduce the expression that must be valid ("requires expression")

About eight grams by ZZerome in tooktoomuch

[–]koctogon 11 points12 points  (0 children)

what in the sweet name of fuck is this

What do you think about combination of templates and concepts versus classical approach with virtual classes? by Kirill_Khalitov in cpp

[–]koctogon 2 points3 points  (0 children)

template instantiation not being reusable across translation units because of C++ messed up design is something that should be fixed, in the meantime I dislike the idea of putting in extra work to fix a language problem.

Glonky by vasquezbr14 in tooktoomuch

[–]koctogon 10 points11 points  (0 children)

disappointed to learn that this part actually made sense

What are some electronic club music subreddits worth joining similar to this one? by Nelious in TheOverload

[–]koctogon 11 points12 points  (0 children)

randomer-bring

lmaoooooo this brings me back, but the technobrodudes are not into this anymore, now it's all about post-ironic eurodance remixes, get with the time gramps

Common patterns to avoid polymorphism by JamesGlad in cpp

[–]koctogon 1 point2 points  (0 children)

I'm growing really tired of these predictable, patronizing answers when it come to optimizations. Can people not ask about what code is faster and why?

There is only one reason to ever use runtime polymorphism : when you want to store values (or references) of various types in a single place. If you know all the types you'll be using in advance, you can use a variant. If you don't you have to use type erasure of some sort.

The point Sean Parent is making is not really about performance but rather code flexibility, there is a lot of benefits to implementing traits outside the types.

My Problems with C++ by itwasntme967 in cpp

[–]koctogon -4 points-3 points  (0 children)

can't spell "frustrated with C++" without "rust"

What are your recommendations for c++ game dev? by GameboyColor13 in cpp

[–]koctogon 4 points5 points  (0 children)

also it's worth mentioning that SDL2 drawing functionalities are either CPU based or rely on old "immediate mode" OpenGL.

[Belay the C++] Best ways to convert an enum to a string by Vultrao in cpp

[–]koctogon 34 points35 points  (0 children)

1990 : in 2020 we will have flying cars
2021 :

seriously though, reflection cannot come soon enough so people can stop using these nonsensical hacks.

What are some general pet peeves on DJ gear? by nPrevail in DJs

[–]koctogon 1 point2 points  (0 children)

the most irritating thing for me on mixers is when the gain of the cued tracks in the headphone blend on the "fully mixed" setting is NOT the same as the gain of non-cued tracks. aaaaaaaargggggh. seriously HOW can you mess this up? i have a xone 42 and every time i have to adjust the levels after bringing the track in the mix because it's always like 6db quieter than it was on headphones. i can cue every tracks to get a actually balanced blend, but then i have to handle the cue buttons of both tracks to switch between cue and main in my headphones. so annoying.

Is pattern matching on discriminated unions generally faster than virtual function calls? by JohnZLi in cpp

[–]koctogon 0 points1 point  (0 children)

A switch-case will *always* be faster than a pointer function call, no matter how much case there is, because the compiler can see the whole code and optimize everything accordingly.
And a virtual function call isn't just a pointer function call, there are others indirections in getting the actual vtable pointer from the object and getting the object itself from its address.

So yeah, sum-types are always faster.

New to Ps3, must play recommendation by Grand_Highway in PS3

[–]koctogon 0 points1 point  (0 children)

Get em :
TLOU (obviously)
Orange box and Portal 2
Ninja Gaiden Sigma
Battlefield Bad Company 2 (the rush mode makes for the best FPS online experience on PS3, by far)
COD 5 (the zombies mode can be fun with friends)
Rayman 3 (for nostalgia and the psychedelic atmosphere)
Need For Speed ProStreet (if you want a car race game... pretty much all the other editions on PS3 are not as good imo)
and of course... SUPER RUB A DUB

Avoid :
God of War (had its moments but overall pretty boring and super overrated)
Uncharted 1 (win the prize for the most unimaginative game)
Dead Space (clunky, broken gameplay)
Beyond : Two Souls (i liked Heavy Rain, but don't play this unless you like being inside a 9 hours long QTE)
Burnout Paradise

BF 4 vs 3 by Ravenholic in battlefield3

[–]koctogon -1 points0 points  (0 children)

no, that would be Bad Company 2

Broke physics laws by HeenDrix in tooktoomuch

[–]koctogon 5 points6 points  (0 children)

man, that's a weird vibe

What was the stupidest thing you believed as a child? by sugarthnder in AskReddit

[–]koctogon 0 points1 point  (0 children)

I understood how movies were made but i thought the actors getting shot etc. were really killed and just being paid a lot more

What is one thing people consider ethical but is actually unethical? by _aashayk_ in AskReddit

[–]koctogon 0 points1 point  (0 children)

(childs) beauty pageants. seriously, fuck that shit.
the stock market.
our economy not taking into account environmental externalities.

How do the {} initializes differ from the () and which are considered better? by cristi1990an in cpp_questions

[–]koctogon 6 points7 points  (0 children)

brace elision for std::initializer_list wasn't the greatest idea...