mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-11-04 01:03:04 +00:00 
			
		
		
		
	Use lambda instead of boost::build when genenic lambdas are available in the compiler
This commit is contained in:
		@@ -76,6 +76,14 @@ target_compile_definitions(front-end-cal
 | 
			
		||||
    PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
 | 
			
		||||
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
 | 
			
		||||
target_compile_definitions(front-end-cal
 | 
			
		||||
    PRIVATE
 | 
			
		||||
        "$<$<COMPILE_FEATURES:cxx_generic_lambdas>:${has_generic_lambdas}>"
 | 
			
		||||
        "$<$<NOT:$<COMPILE_FEATURES:cxx_generic_lambdas>>:${no_has_generic_lambdas}>"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if(ENABLE_CLANG_TIDY)
 | 
			
		||||
    if(CLANG_TIDY_EXE)
 | 
			
		||||
        set_target_properties(front-end-cal
 | 
			
		||||
 
 | 
			
		||||
@@ -38,7 +38,6 @@
 | 
			
		||||
#include "gps_l1_ca_pcps_acquisition_fine_doppler.h"
 | 
			
		||||
#include "gps_utc_model.h"
 | 
			
		||||
#include <boost/any.hpp>  // for bad_any_cast
 | 
			
		||||
#include <boost/bind.hpp>
 | 
			
		||||
#include <boost/exception/exception.hpp>
 | 
			
		||||
#include <boost/lexical_cast.hpp>
 | 
			
		||||
#include <gflags/gflags.h>
 | 
			
		||||
@@ -70,6 +69,11 @@
 | 
			
		||||
#include <utility>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
#if HAS_GENERIC_LAMBDA
 | 
			
		||||
#else
 | 
			
		||||
#include <boost/bind.hpp>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if HAS_STD_FILESYSTEM
 | 
			
		||||
#include <filesystem>
 | 
			
		||||
namespace fs = std::filesystem;
 | 
			
		||||
@@ -142,7 +146,12 @@ void FrontEndCal_msg_rx::msg_handler_events(const pmt::pmt_t& msg)
 | 
			
		||||
FrontEndCal_msg_rx::FrontEndCal_msg_rx() : gr::block("FrontEndCal_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
 | 
			
		||||
{
 | 
			
		||||
    this->message_port_register_in(pmt::mp("events"));
 | 
			
		||||
    this->set_msg_handler(pmt::mp("events"), boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1));
 | 
			
		||||
    this->set_msg_handler(pmt::mp("events"),
 | 
			
		||||
#if HAS_GENERIC_LAMBDA
 | 
			
		||||
        [this](auto&& PH1) { msg_handler_events(PH1); });
 | 
			
		||||
#else
 | 
			
		||||
        boost::bind(&FrontEndCal_msg_rx::msg_handler_events, this, _1));
 | 
			
		||||
#endif
 | 
			
		||||
    rx_message = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user