etsi_its_messages 2.4.0
Loading...
Searching...
No Matches
cdd_checks.h File Reference

Sanity-check functions etc. for the ETSI ITS Common Data Dictionary (CDD) More...

Go to the source code of this file.

Functions

template<typename T1 , typename T2 >
void throwIfOutOfRange (const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
 

Detailed Description

Sanity-check functions etc. for the ETSI ITS Common Data Dictionary (CDD)

Definition in file cdd_checks.h.

Function Documentation

◆ throwIfOutOfRange()

template<typename T1 , typename T2 >
void throwIfOutOfRange ( const T1 & val,
const T2 & min,
const T2 & max,
const std::string val_desc )

Definition at line 36 of file cdd_checks.h.

36 {
37 if (val < min || val > max)
38 throw std::invalid_argument(val_desc + " value is out of range (" + std::to_string(min) + "..." +
39 std::to_string(max) + ")!");
40}