4 ms·
>careful when dealing with generics / operator overloading In C++, you can't overload operators for built-in types and template parameters are normally constra
by protomolecule 2y ago
>careful when dealing with generics / operator overloading
In C++, you can't overload operators for built-in types and template parameters are normally constrained:
auto f(std::integral auto x) noexcept
{
return x+x;
}
But yes, writing C++ templates that work with wide range of types takes some thinking and operator overloading adds to the mental load (or reduces it, when used sparingly and properly).
>"Operations on basic types" can now invoke UB
They always could. I don't want this conversation to become about Rust vs. C++, I'd gladly use Rust when where is appropriate task.
>needs a concrete example to discuss
Write a new post when you come up with a bunch of good examples)
- Expurple 2y agoSure. Thanks for the conversation. If you're interested in the follow up, I have an RSS feed: https://home.expurple.me/posts/index.xml https://home.expurple.me/posts/index.xml
- protomolecule 2y agoThanks! What do people use nowadays to follow rss? A telegram bot perhaps?
- Expurple 2y agoHonestly, no idea. I got into RSS about a year ago. I just use Thunderbird, which I already use for my mail
- protomolecule 2y agoI'll see how this one works: https://t.me/FeedRiverBot https://t.me/FeedRiverBot