Use a bind statement instead of a lambda

master
Chris Robinson 2022-08-29 01:12:09 -07:00
parent 84134d7399
commit 524f254c3a
1 changed files with 4 additions and 2 deletions

View File

@ -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>{});