Show newer

Well, at least std::ranges::search returns a subrange, I guess it might not be the worst thing that happened to standard library since iostreams after all.

But why doesn't it return the end iterators for both sentinels used huh, you niebloid?! Oh, perhaps because it doesn't freaking matter? Is is possible that every algorithm doesn't also need to be a find_if? OMG could it be that if I want/need an end iterator, I just wouldn't use/setup a sentinel in the first place??

Sad c++ programmers are so afraid to write new algorithms, that they have to resort to generators.

Instead of writing
transform(begin, end, dest, f);
ima write
copy(begin, end, tranformer(dest, f));
or
copy(transformed(begin, end, f), dest);

or instead of
copy_until(begin, dest, condition);
ima write
copy(begin, sentinel(condition), dest);
where the opertor != of begin and sentinel is overloaded to be the condition

look ma, I reuse copy, am galaxy brain, let me also overload another stupid operator so that this whole mess looks like this
copy( range | trasnform(f) | filter(f2), dest );
this is so readable, ma role model is haskell, the most bestest readable and not at all cryptic language.

oh no, wait, because of filter, transform is done twice for some elements... I mean, oh yeah, this is a feature!

the gibberish generator of

the happy c++98er without a supporting library: ix.io/3inZ/cpp

the troubled c++17er with a supporting library: ix.io/3ivL/cpp

random number generators take seeding object by lvalue reference, brilliant. I get it, the library was written for c++98, but someone fix it already -_-

A: how to such and such in c++?
B: have you heard about our lord and savior llvm rust?
A: sorry, no time.
B: oh, you'll regret this... the judgement day is nigh! the unbelievers are doomed! mark my words!

so whether tuple_cat works with tuple-like types is implementation defined,
apply doesn't work with them period (except standard tuple-likes),
and make_from_tuple apparently is like apply in c++17, but is supposed to work with them in c++20, and yet no implementation complies... I must know who is responsible for this! some pussy ass library vendor no doubt >:(

old code new question: can you spot the undefined behaviour? omg! and how can I ever recover from this?

Show thread

Obligatory code post after a month:
git.sr.ht/~namark/libsimple_mo
It's not exactly a timer, but can use empty structs to to turn it into one, like this:
git.sr.ht/~namark/truwo/tree/0

I will separate it from the interpolation eventually, maybe in another year or so, though at that point the class would become so small it might just disintegrate into a bunch of free functions.

Example of inconvenience caused by disallowing 0 duration:
git.sr.ht/~namark/sketchbook/c
Very painful, but not hopeless, there is room for improvement.

Show thread

I wrote

container.push_back(item);
auto& new_item = container.front();

and suffered grave consequences.

From now on i will only write

auto& new_item = container.emplace_back(item);

std::visit should have been called transform and should have worked with tuples

std::reduce as it is now should have just been an std::accumulate overload (barring the default init, which is evil, and should be instead inferred from the operator when possible, through some standard interface)

a function called reduce should support partial reductions

my vector type is not properly vectorized by the compilers in non trivial programs... re

I have discovered an obvious serious flaw in my plan, that threatens to render std::rotate inapplicable D:

Show thread

Why does arrow operator not drill through raw pointers to the final value? Pointers don't have members anyway :V

Show thread
Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.