DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
docwire::ranged< Min, Max, T, safety_level > Class Template Reference

A wrapper for numeric types that enforces a range [Min, Max]. More...

#include <ranged.h>

Public Member Functions

 ranged (T value)
 Constructs a ranged value, enforcing the bounds in strict mode. More...
 
 operator T () const
 Implicit conversion to the underlying type.
 
get () const
 

Detailed Description

template<auto Min, auto Max, typename T, safety_policy safety_level = default_safety_level>
class docwire::ranged< Min, Max, T, safety_level >

A wrapper for numeric types that enforces a range [Min, Max].

In strict mode, the constructor checks if the value is within the specified range and throws an exception if the invariant is violated. In relaxed mode, this wrapper is a zero-cost abstraction with no runtime checks.

Template Parameters
MinThe minimum allowed value (or unlimited).
MaxThe maximum allowed value (or unlimited).
TThe underlying numeric type.
safety_levelThe safety policy to apply.

Definition at line 45 of file ranged.h.

Constructor & Destructor Documentation

◆ ranged()

template<auto Min, auto Max, typename T , safety_policy safety_level = default_safety_level>
docwire::ranged< Min, Max, T, safety_level >::ranged ( value)
inline

Constructs a ranged value, enforcing the bounds in strict mode.

Parameters
valueThe value to wrap.

Definition at line 60 of file ranged.h.


The documentation for this class was generated from the following file: