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::cv_free_pod_like Concept Reference

Concept for POD-like types that are free of const or volatile qualification. More...

#include <jh/pods/pod_like.h>

Concept definition

template<typename T>
concept cv_free_pod_like =
!std::is_const_v<T> &&
!std::is_volatile_v<T>
Concept for POD-like types that are free of const or volatile qualification.
Definition pod_like.h:74
Concept for types that are safe to treat as plain old data (POD).
Definition pod_like.h:44

Detailed Description

Concept for POD-like types that are free of const or volatile qualification.

Definition

Equivalent to pod_like<T>, but adds the requirement that T itself must not be const-qualified nor volatile-qualified.

Motivation

In certain templates—such as pod::pair<T1, T2>—using const-qualified inner types (e.g., pair<const int, int>) would violate standard layout or trivially-copyable constraints, rendering the resulting type non-POD.

This concept ensures that only unqualified POD-like types are used in such contexts, while still allowing const pod::pair<...> to remain valid.

Example