Skip to content

Commit

Permalink
Add forward<class T> functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tigran2008 authored Jul 7, 2024
1 parent bb71b60 commit dd437f9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/etl/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,23 @@ namespace etl
}
};
#endif

#if ETL_USING_CPP11
//*****************************************************************************
// forward
//*****************************************************************************
template <class T>
ETL_CONSTEXPR14 T&& forward(typename etl::remove_reference<T>::type& t) noexcept
{
return static_cast<T&&>(t);
}

template <class T>
ETL_CONSTEXPR14 T&& forward(typename etl::remove_reference<T>::type&& t) noexcept
{
return static_cast<T&&>(t);
}
#endif
}

#endif

0 comments on commit dd437f9

Please sign in to comment.