Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
container.h File Reference

C++20 concepts for container and collection types. More...

#include <concepts>
#include <type_traits>
#include <iterator>
Include dependency graph for container.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::concepts
 C++20 concepts for compile-time type validation.
 

Concepts

concept  kcenon::common::concepts::Container
 A type that satisfies basic container requirements.
 
concept  kcenon::common::concepts::SequenceContainer
 A container that provides sequential access and modification.
 
concept  kcenon::common::concepts::AssociativeContainer
 A container that provides key-based access.
 
concept  kcenon::common::concepts::MappingContainer
 A container that maps keys to values.
 
concept  kcenon::common::concepts::ResizableContainer
 A container that can be resized.
 
concept  kcenon::common::concepts::ClearableContainer
 A container that can be cleared.
 
concept  kcenon::common::concepts::InsertableContainer
 A container that supports insert operations.
 
concept  kcenon::common::concepts::ErasableContainer
 A container that supports erase operations.
 
concept  kcenon::common::concepts::RandomAccessContainer
 A container that supports random access via operator[].
 
concept  kcenon::common::concepts::BoundedContainer
 A container with fixed maximum capacity.
 
concept  kcenon::common::concepts::ThreadSafeContainer
 A container designed for thread-safe access.
 
concept  kcenon::common::concepts::PoolableContainer
 A container that supports object pooling operations.
 
concept  kcenon::common::concepts::CircularBuffer
 A container that operates as a circular buffer.
 

Detailed Description

C++20 concepts for container and collection types.

This header provides concepts for validating container types used throughout the common_system library. These concepts enable compile-time validation with clear error messages.

Requirements:

  • C++20 compiler with concepts support
  • GCC 10+, Clang 10+, MSVC 2022+

Thread Safety:

  • Concepts are evaluated at compile-time only.
  • No runtime thread-safety considerations apply.
See also
https://en.cppreference.com/w/cpp/language/constraints

Definition in file container.h.