piranha  0.10
Public Member Functions | List of all members
piranha::safe_cast_impl< To, From, typename > Struct Template Reference

Default implementation of piranha::safe_cast(). More...

#include <piranha/safe_cast.hpp>

Public Member Functions

template<typename T , enabler< T > = 0>
To operator() (const T &f) const
 Call operator. More...
 

Detailed Description

template<typename To, typename From, typename = void>
struct piranha::safe_cast_impl< To, From, typename >

Default implementation of piranha::safe_cast().

The default implementation of piranha::safe_cast() is activated only when the source type coincides with the target type. A copy of the input value will be returned.

Definition at line 63 of file safe_cast.hpp.

Member Function Documentation

◆ operator()()

template<typename To , typename From , typename = void>
template<typename T , enabler< T > = 0>
To piranha::safe_cast_impl< To, From, typename >::operator() ( const T &  f) const
inline

Call operator.

Note
This call operator is enabled only if:
  • T, To and From are the same type,
  • To is copy-constructible.
Parameters
fconversion argument.
Returns
a copy of f.
Exceptions
unspecifiedany exception thrown by the copy/move constructor of From.

Definition at line 85 of file safe_cast.hpp.


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