Commit 36a05e0c authored by Jan Koniarik's avatar Jan Koniarik
Browse files

Added rotation methods for bounded

parent 0ac18ddf
......@@ -77,6 +77,16 @@ public:
return val_;
}
void rotate_right( T step )
{
val_ = min_val + ( val_ + step - min_val ) % ( max_val - min_val );
}
void rotate_left( T step )
{
val_ = min_val + ( val_ - step - min_val ) % ( max_val - min_val );
}
friend constexpr auto operator<=>( const bounded&, const bounded& ) = default;
// template < std::totally_ordered_with< T > U >
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment