![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Utilities for safe type narrowing conversions. More...
#include "shambase/SourceLocation.hpp"#include "shambase/exception.hpp"#include "shambase/stacktrace.hpp"#include "shambase/string.hpp"#include "shambase/type_traits.hpp"#include <limits>#include <stdexcept>
Include dependency graph for narrowing.hpp:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Namespaces | |
| namespace | shambase |
| namespace for basic c++ utilities | |
Functions | |
| template<class U , class T > | |
| constexpr bool | shambase::can_narrow (T val) |
| Check if an integer value can be safely narrowed to a target type. | |
| template<class U , class T > | |
| U | shambase::narrow_or_throw (T val, SourceLocation &&callsite=SourceLocation{}) |
Utilities for safe type narrowing conversions.
Definition in file narrowing.hpp.