>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)