diff options
author | Matthew Gregan <[email protected]> | 2021-11-29 12:49:27 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2021-12-04 09:45:14 +1300 |
commit | 75d9d125ee655ef80f3bfcd97ae5a805931042b8 (patch) | |
tree | 8f7b841ab373479bc61bdd5ff29d4a939184a795 | |
parent | 5b0b7f6bf7c7a874abcb31de8dd386f147bab539 (diff) | |
download | cubeb-75d9d125ee655ef80f3bfcd97ae5a805931042b8.tar.gz cubeb-75d9d125ee655ef80f3bfcd97ae5a805931042b8.zip |
mixer: Replace std::result_of with decltype.
Fixes issue #677.
-rw-r--r-- | src/cubeb_mixer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cubeb_mixer.cpp b/src/cubeb_mixer.cpp index 343e0e2..74bab71 100644 --- a/src/cubeb_mixer.cpp +++ b/src/cubeb_mixer.cpp @@ -410,9 +410,8 @@ sum2(TYPE_SAMPLE * out, uint32_t stride_out, const TYPE_SAMPLE * in1, TYPE_COEFF coeff2, F && operand, uint32_t frames) { static_assert( - std::is_same<TYPE_COEFF, - typename std::result_of<F(TYPE_COEFF)>::type>::value, - "function must return the same type as used by matrix_coeff"); + std::is_same<TYPE_COEFF, decltype(operand(coeff1))>::value, + "function must return the same type as used by coeff1 and coeff2"); for (uint32_t i = 0; i < frames; i++) { *out = operand(coeff1 * *in1 + coeff2 * *in2); out += stride_out; @@ -426,10 +425,8 @@ void copy(TYPE_SAMPLE * out, uint32_t stride_out, const TYPE_SAMPLE * in, uint32_t stride_in, TYPE_COEFF coeff, F && operand, uint32_t frames) { - static_assert( - std::is_same<TYPE_COEFF, - typename std::result_of<F(TYPE_COEFF)>::type>::value, - "function must return the same type as used by matrix_coeff"); + static_assert(std::is_same<TYPE_COEFF, decltype(operand(coeff))>::value, + "function must return the same type as used by coeff"); for (uint32_t i = 0; i < frames; i++) { *out = operand(coeff * *in); out += stride_out; @@ -443,8 +440,7 @@ rematrix(const MixerContext * s, TYPE * aOut, const TYPE * aIn, const TYPE_COEFF (&matrix_coeff)[COLS][COLS], F && aF, uint32_t frames) { static_assert( - std::is_same<TYPE_COEFF, - typename std::result_of<F(TYPE_COEFF)>::type>::value, + std::is_same<TYPE_COEFF, decltype(aF(matrix_coeff[0][0]))>::value, "function must return the same type as used by matrix_coeff"); for (uint32_t out_i = 0; out_i < s->_out_ch_count; out_i++) { |