Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
BS::move_only_function< R(Args...)> Class Template Reference

A simple polyfill for std::move_only_function, to be used if C++23 features are not available. Note that it does not have all the features of std::move_only_function, only the minimum needed for the thread pool library. More...

#include <BS_thread_pool.hpp>

Classes

struct  func_concept
 
struct  func_model
 

Public Member Functions

 move_only_function (move_only_function &&) noexcept=default
 
move_only_functionoperator= (move_only_function &&) noexcept=default
 
 move_only_function (const move_only_function &)=delete
 
move_only_functionoperator= (const move_only_function &)=delete
 
template<typename F , typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, move_only_function> && std::is_invocable_r_v<R, F&, Args...>>>
 move_only_function (F &&func)
 
operator() (Args... args)
 

Private Attributes

std::unique_ptr< func_concept > ptr = nullptr
 

Detailed Description

template<typename R, typename... Args>
class BS::move_only_function< R(Args...)>

A simple polyfill for std::move_only_function, to be used if C++23 features are not available. Note that it does not have all the features of std::move_only_function, only the minimum needed for the thread pool library.

Template Parameters
RThe return type of the function.
ArgsThe argument types of the function.

Constructor & Destructor Documentation

◆ move_only_function()

template<typename R , typename... Args>
template<typename F , typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, move_only_function> && std::is_invocable_r_v<R, F&, Args...>>>
BS::move_only_function< R(Args...)>::move_only_function ( F &&  func)
inline
323: ptr(std::make_unique<func_model<std::decay_t<F>>>(std::forward<F>(func))) {} // NOLINT(hicpp-explicit-conversions)

Member Function Documentation

◆ operator()()

template<typename R , typename... Args>
R BS::move_only_function< R(Args...)>::operator() ( Args...  args)
inline
326 {
327 return ptr->call(std::forward<Args>(args)...);
328 }

The documentation for this class was generated from the following file: