Skip to content

Commit

Permalink
execute: mark more things constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Sep 30, 2020
1 parent 0547acd commit 86567c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ inline T load(bytes_view input, size_t offset) noexcept
}

template <typename DstT, typename SrcT>
inline DstT extend(SrcT in) noexcept
inline constexpr DstT extend(SrcT in) noexcept
{
if constexpr (std::is_same_v<SrcT, DstT>)
return in;
Expand Down Expand Up @@ -73,7 +73,7 @@ inline bool load_from_memory(
}

template <typename DstT>
inline DstT shrink(Value value) noexcept
inline constexpr DstT shrink(Value value) noexcept
{
if constexpr (std::is_floating_point_v<DstT>)
return value.as<DstT>();
Expand Down Expand Up @@ -204,7 +204,7 @@ inline constexpr T rem(T a, T b) noexcept
}

template <typename T>
inline T shift_left(T lhs, T rhs) noexcept
inline constexpr T shift_left(T lhs, T rhs) noexcept
{
static_assert(std::is_integral_v<T>);

Expand All @@ -214,7 +214,7 @@ inline T shift_left(T lhs, T rhs) noexcept
}

template <typename T>
inline T shift_right(T lhs, T rhs) noexcept
inline constexpr T shift_right(T lhs, T rhs) noexcept
{
static_assert(std::is_integral_v<T>);

Expand All @@ -224,7 +224,7 @@ inline T shift_right(T lhs, T rhs) noexcept
}

template <typename T>
inline T rotl(T lhs, T rhs) noexcept
inline constexpr T rotl(T lhs, T rhs) noexcept
{
static_assert(std::is_integral_v<T>);

Expand All @@ -238,7 +238,7 @@ inline T rotl(T lhs, T rhs) noexcept
}

template <typename T>
inline T rotr(T lhs, T rhs) noexcept
inline constexpr T rotr(T lhs, T rhs) noexcept
{
static_assert(std::is_integral_v<T>);

Expand Down

0 comments on commit 86567c3

Please sign in to comment.