Skip to content

Commit

Permalink
Make bitCeil function acting on values uniformly callable.
Browse files Browse the repository at this point in the history
  • Loading branch information
HaxyM authored Sep 17, 2024
1 parent 4b00b0e commit 0158a90
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/crap/bit.d/bitceilvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "hassinglebitvalue.h"
#include "../numbers.d/zero.h"
#include "../version.d/char8t.h"
#include "../version.d/libintegralconstantcallable.h"
#include "../version.d/unicodecharacters.h"
#endif

Expand Down Expand Up @@ -52,6 +53,9 @@ namespace crap
((floor == maxPower) && (shift == 1u)) ? zero : ((floor == zero) ? one : ((floor << shift) & ones));
using value_type = decltype(value);
constexpr operator value_type () const noexcept;
#if (crap_lib_integral_constant_callable >= 201304L)
constexpr value_type operator () () const noexcept;
#endif
};
#endif
}
Expand All @@ -64,6 +68,15 @@ typename crap :: bitCeilValue <Type, Value> :: value_type () const noexcept
{
return crap :: bitCeilValue <Type, Value> :: value;
}
#if (crap_lib_integral_constant_callable >= 201304L)

template <class Type, Type Value>
inline constexpr typename crap :: bitCeilValue <Type, Value> :: value_type
crap :: bitCeilValue <Type, Value> :: operator () () const noexcept
{
return crap :: bitCeilValue <Type, Value> :: value;
}
#endif
#endif
#endif

0 comments on commit 0158a90

Please sign in to comment.