Well, I have to admit that this is an old article I didn't think to publish here, but when I saw that someone stole it to their own blog, I think it's a sign that this article is good enough to publish.
std::string_view can optimize both performance and code readability in code sections which handle strings. However it can also lead to UB and to memory issues if used incorrectly.
Well, this article was written using a phone, so it might be possible to read it using one :P
And yes, it's completely true for cases that your custom deleter (pay attention that there is no custom allocator in std::unique_ptr, but it also true to allocators in other structures) doesn't contain any data members :)
Well, I have to admit that this is an old article I didn't think to publish here, but when I saw that someone stole it to their own blog, I think it's a sign that this article is good enough to publish.
Stolen article: https://kukonc-best.randvatar.com/article/the-number-that-br...
Original article: https://cppsenioreas.wordpress.com/2020/10/13/the-number-tha...