Skip to content

Commit

Permalink
Use std::is_integral instead of std::is_integral_v
Browse files Browse the repository at this point in the history
So that C++17 won't be required.
  • Loading branch information
JosJuice committed Dec 1, 2019
1 parent 673dcaa commit 3a007bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hibikase/PlaybackWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void AudioOutputWorker::SetSpeed(double slowdown)
template <typename T>
static void ToFloat(const T* in, std::vector<std::vector<float>>* out)
{
static_assert(std::is_integral_v<T> && std::is_signed_v<T>, "Incompatible type");
static_assert(std::is_integral<T>() && std::is_signed<T>(), "Incompatible type");
const float scale = 1.0f / (std::numeric_limits<T>::max() + 1.0f);

for (size_t i = 0; i < out->size(); ++i)
Expand All @@ -347,7 +347,7 @@ static void ToFloat(const T* in, std::vector<std::vector<float>>* out)
template <typename T>
static void FromFloat(const std::vector<std::vector<float>>& in, T* out)
{
static_assert(std::is_integral_v<T> && std::is_signed_v<T> && sizeof(T) < sizeof(int),
static_assert(std::is_integral<T>() && std::is_signed<T>() && sizeof(T) < sizeof(int),
"Incompatible type");
const int min = std::numeric_limits<T>::min();
const int max = std::numeric_limits<T>::max();
Expand Down

0 comments on commit 3a007bc

Please sign in to comment.