30 October 2024
GSI
Europe/Berlin timezone

fixed_string: why we need another string type and how to produce a never-dangling string_view

30 Oct 2024, 14:05
55m
C27 3.010 - C27 Ebene 3 (GSI)

C27 3.010 - C27 Ebene 3

GSI

Speaker

Dr Matthias Kretz (GSI Helmholtzzentrum für Schwerionenforschung GmbH(GSI))

Description

std::fixed_string is currently in review for C++26.
std::string, std::string_view, and string literals are currently not valid non-type template parameters (NTTP). std::fixed_string wants to fill that hole. But is that its sole purpose? And what about the string_view returned from fixed_string, it's just a pointer to a char array. Under what circumstances does the string_view dangle?

Presentation Materials