Join Nostr
2026-04-16 19:40:27 UTC

CodingInLondon on Nostr: C++ nugget 💡: std::string_view (C++17) A lightweight, non-owning reference to a ...

C++ nugget 💡: 



std::string_view (C++17)

A lightweight, non-owning reference to a string — zero allocation, zero copy.

Instead of passing const std::string&, use string_view to accept any string-like data (string, char*, literals) without copying.

Bitcoin Core uses it heavily in src/util/string.h: