aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-08-29 01:12:09 -0700
committerChris Robinson <[email protected]>2022-08-29 01:12:09 -0700
commit524f254c3a3a3c7dec20c7d07baa0115517483bb (patch)
treef877decfe248cc7e2e14615249d12ea8df111cc8 /common
parent84134d7399fec757fe2051bb74a018a9fa15b7b9 (diff)
Use a bind statement instead of a lambda
Diffstat (limited to 'common')
-rw-r--r--common/alcomplex.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/alcomplex.cpp b/common/alcomplex.cpp
index 126e2c04..28792928 100644
--- a/common/alcomplex.cpp
+++ b/common/alcomplex.cpp
@@ -7,6 +7,7 @@
#include <cassert>
#include <cmath>
#include <cstddef>
+#include <functional>
#include <utility>
#include "albit.h"
@@ -148,6 +149,8 @@ void complex_fft(const al::span<std::complex<double>> buffer, const double sign)
void complex_hilbert(const al::span<std::complex<double>> buffer)
{
+ using namespace std::placeholders;
+
inverse_fft(buffer);
const double inverse_size = 1.0/static_cast<double>(buffer.size());
@@ -156,8 +159,7 @@ void complex_hilbert(const al::span<std::complex<double>> buffer)
*bufiter *= inverse_size; ++bufiter;
bufiter = std::transform(bufiter, halfiter, bufiter,
- [inverse_size](const std::complex<double> &c) -> std::complex<double>
- { return c * (2.0*inverse_size); });
+ std::bind(std::multiplies<>{}, _1, 2.0*inverse_size));
*bufiter *= inverse_size; ++bufiter;
std::fill(bufiter, buffer.end(), std::complex<double>{});