chromium / subspace

A concept-centered standard library for C++20, enabling safer and more reliable products and a more modern feel for C++ code.; Also home of Subdoc the code-documentation generator.
https://suslib.cc
Apache License 2.0
89 stars 15 forks source link

Overload swap() for trivially relocatable types #335

Open danakj opened 1 year ago

danakj commented 1 year ago

Even if a type is conditionally trivially relocatable we can use if constexpr to do a memcpy when possible.

We should do this for the key vocab types like Option, Result, Vec, etc...