mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Allow type to be floating point by changing the comparison operators from == to >= and <=
This commit is contained in:
parent
8f8dbf7771
commit
a985a72840
@ -59,8 +59,6 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
|
||||
|
||||
template <typename U, const U OTHER_FIRST, const U OTHER_LAST> friend class cyclic_value;
|
||||
|
||||
//*************************************************************************
|
||||
@ -166,7 +164,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
cyclic_value& operator ++()
|
||||
{
|
||||
if (value == last_value)
|
||||
if (value >= last_value)
|
||||
{
|
||||
value = first_value;
|
||||
}
|
||||
@ -195,7 +193,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
cyclic_value& operator --()
|
||||
{
|
||||
if (value == first_value)
|
||||
if (value <= first_value)
|
||||
{
|
||||
value = last_value;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user