siplasplas
A library for C++ reflection and introspection
|
Implements the then branch of an static conditional. More...
#include <siplasplas/utility/staticif.hpp>
Public Member Functions | |
template<typename Body , typename... Args> | |
constexpr auto | Then (const Body &body, Args &&...args) -> typename std::enable_if< !std::is_void< decltype(body(::cpp::Identity(), std::forward< Args >(args)...))>::value, ElseBypass< decltype(body(::cpp::Identity(), std::forward< Args >(args)...))> >::type |
template<typename Body , typename... Args> | |
constexpr auto | Then (const Body &body, Args &&...args) -> typename std::enable_if< std::is_void< decltype(body(::cpp::Identity(), std::forward< Args >(args)...))>::value, If & >::type |
template<typename Body , typename... Args> | |
constexpr void | Else (const Body &, Args &&...) |
Implements the then branch of an static conditional.
The cpp::detail::If template implements the internals of an static_if()
. The main template implements the true condition branch (The branch executing the then body). Returning values in this case may not be as efficient as possible since the returned value should bypass the then body (This involves two move operations, see cpp::If::ElseBypass):
Condition | If condition. True in the main template. |