what's the difference between
template<typename T>
auto add1(const T& a, const T& b)
{ return a + b; }
and
template<typename T>
auto add2(T a, const T& b)
{ return a += b; }
?
would you call a wrapper type, that holds a pointer to a container provides a range interface through that pointer, a range_reference or a reference_range?
hmmm... referring_range?? indirect_range???
why would you ever need aligned storage for a single object that just holds a couple of references?
the aligned storage
https://github.com/OpenBW/openbw/blob/master/sync.h#L1019
the class it's used with
https://github.com/OpenBW/openbw/blob/master/sync.h#L354
is it some kind of "as long as it's aligned it's atomic" x86 nonsense? tempted to just nuke it all...
things that bit me:
operator precedence
note: algebra am I right?
overload resolution
note: a universal reference without type constraints in an overload set should be a yellow flag
value/reference semantics:
note: if you want to absolutely make sure you are referring to a value as a constant and not owning one, use const pointer to const value (or something like std::reference_wrapper to exclude nullptr), not a const reference, since, as we all know, a const reference can bind to a temporary and extend its lifetime.
final thoughts: god I wish I had a garbage collector or a borrow checker to save me from... wait none of these are memory errors? how come?
ended up reworking a lot of the ui code... all the Xes and Ys and half-assed SDL wrappers were getting on my nerves, so partially replaced them with my own half-assed SDL wrappers and vector library...
https://notabug.org/fuglycodelord420/openbw/commits/1aa93b122d1da807267d78d52e600f1dee390777
what's new objectively? well you can make an SCV now by pressing S...
so the only value of CMake is that it works on windows? which would be negative value... like every system comes with it's own programming environment and package manager and stuff, and you're like "no, the objective reasons by which you chose your system are irrelevant, a language gotta have a unified build system that nullifies them, hurr durr"...
undefined behavior on line 75!
I should probably stop staring at this and do something useful instead...
witness code compression (>^-^)>
http://ix.io/3vy0/cpp
>but you introduced three new libraries :v
libraries don't count :V
>but your version is also slower :v
it can be optimized >:V nothing inherently slow about it :<
nevermind, the right edge is on the inside too, it's just the bottom, so lets file this under off by one errors... I'm just too used to the two dimensions being consistent
ok so you need to outline a rectangle on square grid, you know yer pixels... logically you can choose to do it on the inside of the rectangle, to make sure you don't go out of bounds, or on the outside if you need the in-bound pixels untouched... however a very common choice is to go completely insane and do the top and left edges on the inside and bottom and right edges on the outside:
https://github.com/OpenBW/openbw/blob/d5fe2306ecb08efdea877a7f4117b178292137cb/ui/ui.h#L1284-L1293
another note: so stupid to ever expect something like this to work, I mean a file is a file, it's not like it's a stream or something, and everything is a file, so it's not like there are any alternatives or something... sheesh grow a brain me...
next is Stardust - absolutely bonkers backwards directory and include structure, but otherwise minimum language level issues. I aint got the micro to kill it with 4 workers, mainly cause probes are OP, so gotta continue working on the UI, but feels like if you can properly body block the building probes you can just kill them one by one, just like with Stormhammer.
apparently MSVC has no problem binding temporaries to lvalue references... why yes, of course, let's break the most basic building blocks of the language
andrew disappeared... filthy #coq peddler :<