Skip to content

Commit 08ab89b

Browse files
committed
is_arithmetic_v
1 parent e3fc743 commit 08ab89b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

include/geode/basic/range.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ namespace geode
8181
: iter_( static_cast< Type >( begin ) ),
8282
last_( static_cast< Type >( end ) )
8383
{
84-
OPENGEODE_EXCEPTION( begin <= static_cast< T1 >(
85-
std::numeric_limits< Type >::max() ),
86-
"[Range] Invalid range" );
87-
OPENGEODE_EXCEPTION(
88-
end <= static_cast< T2 >( std::numeric_limits< Type >::max() ),
89-
"[Range] Invalid range" );
84+
if constexpr( std::is_arithmetic_v< Type > )
85+
{
86+
OPENGEODE_EXCEPTION( begin <= static_cast< T1 >(
87+
std::numeric_limits< Type >::max() ),
88+
"[Range] Invalid range" );
89+
OPENGEODE_EXCEPTION( end <= static_cast< T2 >(
90+
std::numeric_limits< Type >::max() ),
91+
"[Range] Invalid range" );
92+
}
9093
}
9194

9295
private:

0 commit comments

Comments
 (0)