JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::pod::literals Namespace Reference

Official literal helpers for jh::pod types. More...

Functions

constexpr jh::pod::string_view operator""_psv (const char *str, std::size_t len) noexcept
 User-defined literal for jh::pod::string_view.

Detailed Description

Official literal helpers for jh::pod types.

This namespace contains the officially provided literal utilities associated with jh::pod, offering concise and POD-safe construction of view types such as jh::pod::string_view.
These literals are part of the public interface and are intended to be used via:

using namespace jh::pod::literals;
Official literal helpers for jh::pod types.
Definition string_view.h:802

Function Documentation

◆ operator""_psv()

jh::pod::string_view jh::pod::literals::operator""_psv ( const char * str,
std::size_t len )
nodiscardconstexprnoexcept

User-defined literal for jh::pod::string_view.

Converts a string literal to a lightweight, POD-safe string_view.

Example:

using namespace jh::pod::literals;
constexpr auto s = "hello"_psv;
static_assert(s.size() == 5);

This is the only fully standard, portable, and safe form. The literal's storage is static by definition, so the resulting view never dangles.