cpp_boilerplate 0.1.0
C++23 project template with Conan and CMake
Loading...
Searching...
No Matches
cpp_boilerplate Namespace Reference

Public API for the template application. More...

Functions

constexpr auto split_views (std::string_view record, char delimiter=',')
std::vector< std::string_view > split_views_vec (std::string_view record, char delimiter=',')

Detailed Description

Public API for the template application.

Function Documentation

◆ split_views()

auto cpp_boilerplate::split_views ( std::string_view record,
char delimiter = ',' )
nodiscardconstexpr

Lazily split a string view into fields.

The returned fields alias the storage backing record. The caller must keep that buffer alive for as long as the results are used; passing a temporary string dangles.

Definition at line 14 of file split.hpp.

◆ split_views_vec()

std::vector< std::string_view > cpp_boilerplate::split_views_vec ( std::string_view record,
char delimiter = ',' )
nodiscard

Materialize the split fields in a vector.

The returned field views still alias the storage backing record.