|
value-preserving-literals 0.0.1
value-preserving literals for C++
|
Exception thrown when conversion to arithmetic type would change value. More...
#include <val.h>
Public Member Functions | |
| consteval | bad_value_preserving_cast (source_location __where=source_location::current()) noexcept |
| Construct with source location. | |
| consteval | bad_value_preserving_cast (const bad_value_preserving_cast &)=default |
| Defaulted copy constructor. | |
| consteval | bad_value_preserving_cast (bad_value_preserving_cast &&)=default |
| Defaulted move constructor. | |
| consteval bad_value_preserving_cast & | operator= (const bad_value_preserving_cast &)=default |
| Defaulted copy assignment. | |
| consteval bad_value_preserving_cast & | operator= (bad_value_preserving_cast &&)=default |
| Defaulted move assignment. | |
| consteval const char * | what () const noexcept override |
| Get error description. | |
| consteval u8string_view | u8what () const noexcept |
| Get UTF-8 error description. | |
| consteval source_location | where () const noexcept |
| Get source location of the failed conversion. | |
Exception thrown when conversion to arithmetic type would change value.
This exception is thrown at compile time (and can only be caught at compile time) when attempting to convert a constinteger or constreal to an arithmetic type that cannot preserve the exact value (e.g., overflow, precision loss, or range violation).
The type is consteval-only to ensure it can only be used at compile time.
|
inlineconstevalnoexcept |
Construct with source location.
| __where | Source location where the conversion failed |
|
inlineconstevaloverridenoexcept |
Get error description.
|
inlineconstevalnoexcept |
Get UTF-8 error description.
|
inlineconstevalnoexcept |
Get source location of the failed conversion.