QuickCppLib 0.10
Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!
Loading...
Searching...
No Matches
quickcpplib::_xxx::scope Namespace Reference

Namespaces

namespace  detail
 

Typedefs

template<class T >
using scope_exit = detail::scope_impl< T, detail::scope_impl_kind::exit >
 
template<class T >
using scope_fail = detail::scope_impl< T, detail::scope_impl_kind::fail >
 
template<class T >
using scope_success = detail::scope_impl< T, detail::scope_impl_kind::success >
 

Functions

template<class T , typename = decltype(std::declval<T>()()), typename std::enable_if< detail::is_nothrow_invocable< T >(), bool >::type = true>
constexpr auto make_scope_exit (T &&v)
 
template<class T , typename = decltype(std::declval<T>()()), typename std::enable_if< detail::is_nothrow_invocable< T >(), bool >::type = true>
constexpr auto make_scope_fail (T &&v)
 
template<class T , typename = decltype(std::declval<T>()())>
constexpr auto make_scope_success (T &&v)
 

Typedef Documentation

◆ scope_exit

template<class T >
using quickcpplib::_xxx::scope::scope_exit = typedef detail::scope_impl<T, detail::scope_impl_kind::exit>

◆ scope_fail

template<class T >
using quickcpplib::_xxx::scope::scope_fail = typedef detail::scope_impl<T, detail::scope_impl_kind::fail>

◆ scope_success

template<class T >
using quickcpplib::_xxx::scope::scope_success = typedef detail::scope_impl<T, detail::scope_impl_kind::success>

Function Documentation

◆ make_scope_exit()

template<class T , typename = decltype(std::declval<T>()()), typename std::enable_if< detail::is_nothrow_invocable< T >(), bool >::type = true>
constexpr auto quickcpplib::_xxx::scope::make_scope_exit ( T &&  v)
inlineconstexpr
154 {
155 return scope_exit<typename std::decay<T>::type>(static_cast<T &&>(v));
156 }
detail::scope_impl< T, detail::scope_impl_kind::exit > scope_exit
Definition scope.hpp:140

◆ make_scope_fail()

template<class T , typename = decltype(std::declval<T>()()), typename std::enable_if< detail::is_nothrow_invocable< T >(), bool >::type = true>
constexpr auto quickcpplib::_xxx::scope::make_scope_fail ( T &&  v)
inlineconstexpr
166 {
167 return scope_fail<typename std::decay<T>::type>(static_cast<T &&>(v));
168 }
detail::scope_impl< T, detail::scope_impl_kind::fail > scope_fail
Definition scope.hpp:141

◆ make_scope_success()

template<class T , typename = decltype(std::declval<T>()())>
constexpr auto quickcpplib::_xxx::scope::make_scope_success ( T &&  v)
inlineconstexpr
176 {
177 return scope_success<typename std::decay<T>::type>(static_cast<T &&>(v));
178 }
detail::scope_impl< T, detail::scope_impl_kind::success > scope_success
Definition scope.hpp:142