Skip to content

Commit

Permalink
assertion: Add static_assert
Browse files Browse the repository at this point in the history
Add a compile time test via static_assert to ensure that gr_complex and
gfdm_complex alias the same type.

Signed-off-by: Johannes Demel <[email protected]>
  • Loading branch information
jdemel committed May 9, 2022
1 parent e1ad8e9 commit 393bb53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/advanced_receiver_kernel_cc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <gnuradio/io_signature.h>
#include <gfdm/advanced_receiver_kernel_cc.h>
#include <type_traits>
#include <volk/volk.h>

namespace gr {
Expand All @@ -45,6 +46,8 @@ advanced_receiver_kernel_cc::advanced_receiver_kernel_cc(
d_kernel(std::make_unique<receiver_kernel_cc>(
timeslots, subcarriers, overlap, frequency_taps))
{
static_assert(std::is_same<gr_complex, gr::gfdm::gfdm_kernel_utils::gfdm_complex>(),
"gr_complex and gfdm_complex MUST alias the same type!");
// Initialize buffers for temporary subcarrier data
d_freq_block.resize(d_kernel->block_size());
d_ic_time_buffer.resize(d_kernel->block_size());
Expand Down

0 comments on commit 393bb53

Please sign in to comment.