Support Class Library
A set of tools providing classes and utility
Namespaces | Classes | Typedefs | Functions | Variables
scl::utils Namespace Reference

Utility classes (and rare functions) More...

Namespaces

 details
 Implementation details for the utility classes.
 
 placeholder
 Namespace holding the constexpr global variable "_".
 

Classes

class  Any
 Class that can hold any value type (and change value type mid lifetime) More...
 
class  Either
 Alternative type that stores one or the other. More...
 
struct  None
 An empty class serving as the type of an empty Optional<T> More...
 
class  Optional
 A class that allows the use of optional types (might be there) More...
 
struct  Placeholder
 Class representing parameter/return argument placholders. More...
 
class  RawStorage
 Class that handles raw storage (and manual memory management) for a variable type. More...
 
class  Result
 
struct  ToString
 
class  ToString< None >
 A specialization of ToString for None type. More...
 
struct  ToString< scl::http::StatusCode >
 
struct  ToString< scl::http::Version, void >
 

Typedefs

template<class F , class... Args>
using invoke_result_t = decltype(invoke(std::declval< F >(), std::declval< Args >()...))
 

Functions

template<class R , class... Args>
invoke (scl::tools::meta ::fn_sig_type< R, Args... > fn, Args &&... args)
 
template<class R , class Class , class... Args>
invoke (scl::tools::meta ::memfn_type< R, Class, Args... > fn, Class &obj, Args &&... args)
 
template<class R , class Class , class... Args>
invoke (scl::tools::meta ::const_memfn_type< R, Class, Args... > fn, const Class &obj, Args &&... args)
 
template<class R , class Class , class... Args>
invoke (scl::tools::meta ::memfn_type< R, Class, Args... > fn, Class &&obj, Args &&... args)
 
template<class R , class Class , class... Args>
invoke (scl::tools::meta ::memfn_type< R, Class, Args... > fn, Class *const obj, Args &&... args)
 
template<class R , class Class , class... Args>
invoke (scl::tools::meta ::const_memfn_type< R, Class, Args... > fn, const Class *const obj, Args &&... args)
 
template<class R , class Class >
invoke (scl::tools::meta ::mem_ptr_type< R, Class > fn, const Class &obj)
 
template<class R , class Class >
invoke (scl::tools::meta ::mem_ptr_type< R, Class > fn, const Class *obj)
 
template<class F , class... Args>
auto invoke (F &&fn, Args &&... args) -> decltype(std::forward< F >(fn)(std::forward< Args >(args)...))
 
template<class T >
Result< T, std::exception_ptr > wrapInResult (std::function< T()> f)
 
template<class T >
std::string toString (const T &obj)
 Free function that allows string conversion. More...
 

Variables

constexpr None none = None{}
 A constant global variable of type None. More...
 

Detailed Description

Utility classes (and rare functions)

Typedef Documentation

◆ invoke_result_t

template<class F , class... Args>
using scl::utils::invoke_result_t = typedef decltype(invoke(std::declval<F>(), std::declval<Args>()...))

Definition at line 109 of file invoke.h.

Function Documentation

◆ invoke() [1/9]

template<class R , class... Args>
R scl::utils::invoke ( scl::tools::meta ::fn_sig_type< R, Args... >  fn,
Args &&...  args 
)
inline

Definition at line 44 of file invoke.h.

◆ invoke() [2/9]

template<class R , class Class , class... Args>
R scl::utils::invoke ( scl::tools::meta ::memfn_type< R, Class, Args... >  fn,
Class &  obj,
Args &&...  args 
)
inline

Definition at line 52 of file invoke.h.

◆ invoke() [3/9]

template<class R , class Class , class... Args>
R scl::utils::invoke ( scl::tools::meta ::const_memfn_type< R, Class, Args... >  fn,
const Class &  obj,
Args &&...  args 
)
inline

Definition at line 60 of file invoke.h.

◆ invoke() [4/9]

template<class R , class Class , class... Args>
R scl::utils::invoke ( scl::tools::meta ::memfn_type< R, Class, Args... >  fn,
Class &&  obj,
Args &&...  args 
)
inline

Definition at line 68 of file invoke.h.

◆ invoke() [5/9]

template<class R , class Class , class... Args>
R scl::utils::invoke ( scl::tools::meta ::memfn_type< R, Class, Args... >  fn,
Class *const  obj,
Args &&...  args 
)
inline

Definition at line 76 of file invoke.h.

◆ invoke() [6/9]

template<class R , class Class , class... Args>
R scl::utils::invoke ( scl::tools::meta ::const_memfn_type< R, Class, Args... >  fn,
const Class *const  obj,
Args &&...  args 
)
inline

Definition at line 84 of file invoke.h.

◆ invoke() [7/9]

template<class R , class Class >
R scl::utils::invoke ( scl::tools::meta ::mem_ptr_type< R, Class >  fn,
const Class &  obj 
)
inline

Definition at line 92 of file invoke.h.

◆ invoke() [8/9]

template<class R , class Class >
R scl::utils::invoke ( scl::tools::meta ::mem_ptr_type< R, Class >  fn,
const Class *  obj 
)
inline

Definition at line 97 of file invoke.h.

◆ invoke() [9/9]

template<class F , class... Args>
auto scl::utils::invoke ( F &&  fn,
Args &&...  args 
) -> decltype( std::forward<F>(fn)( std::forward<Args>(args)... ) )
inline

Definition at line 102 of file invoke.h.

◆ toString()

template<class T >
std::string scl::utils::toString ( const T &  obj)

Free function that allows string conversion.

Template Parameters
Tthe type of object to convert to string
Returns
the string representation of the object

Definition at line 57 of file toString.h.

◆ wrapInResult()

template<class T >
Result<T, std::exception_ptr> scl::utils::wrapInResult ( std::function< T()>  f)

Definition at line 214 of file Result.h.

Variable Documentation

◆ none

scl::utils::none = None{}

A constant global variable of type None.

Definition at line 41 of file Optional.h.