commit 570391d199744e37b5501fdf7bd59d90d7205c9f
parent f3009bb584c6390733587de59db52e563d003638
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Tue, 9 Aug 2016 05:56:01 +0300
biquad.hpp: conversion for biquad_params
Diffstat:
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -1,16 +1,16 @@
# Copyright (C) 2016 D Levin (http://www.kfrlib.com)
# This file is part of KFR
-#
+#
# KFR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-#
+#
# KFR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with KFR.
@@ -52,7 +52,11 @@ include(sources.cmake)
set(ALL_WARNINGS -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c99-extensions -Wno-padded)
-set(STD_LIB stdc++)
+if (IOS)
+ set(STD_LIB)
+else ()
+ set(STD_LIB stdc++)
+endif ()
if (NOT MSVC)
add_compile_options(-std=c++1y)
diff --git a/include/kfr/dsp/biquad.hpp b/include/kfr/dsp/biquad.hpp
@@ -44,6 +44,15 @@ enum class biquad_type
template <typename T>
struct biquad_params
{
+ template <typename U>
+ constexpr biquad_params(const biquad_params<U>& bq) noexcept : a0(static_cast<T>(bq.a0)),
+ a1(static_cast<T>(bq.a1)),
+ a2(static_cast<T>(bq.a2)),
+ b0(static_cast<T>(bq.b0)),
+ b1(static_cast<T>(bq.b1)),
+ b2(static_cast<T>(bq.b2))
+ {
+ }
constexpr static bool is_pod = true;
static_assert(std::is_floating_point<T>::value, "T must be a floating point type");