mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Inlined safe conversion functions.
This commit is contained in:
parent
b6a67275c9
commit
5fee5cece8
@ -46,7 +46,7 @@ namespace Opm::cuistl::detail
|
||||
*
|
||||
* @todo This can be done for more generic types, but then it is probably wise to wait for C++20's cmp-functions
|
||||
*/
|
||||
int
|
||||
inline int
|
||||
to_int(size_t s)
|
||||
{
|
||||
static_assert(
|
||||
@ -80,7 +80,7 @@ to_int(size_t s)
|
||||
* @throw std::invalid_argument if i is negative.
|
||||
* @todo This can be done for more generic types, but then it is probably wise to wait for C++20's cmp-functions
|
||||
*/
|
||||
size_t
|
||||
inline size_t
|
||||
to_size_t(int i)
|
||||
{
|
||||
static_assert(
|
||||
|
Loading…
Reference in New Issue
Block a user