|
RESTinio
|
A metafunction that checks is Result_Type can be used as the result of transformation method. More...
#include <easy_parser.hpp>
Public Types | |
| using | producer_result_t |
| using | transformation_result_t |
| using | expected_result_t = typename Transformer::result_type |
Static Public Attributes | |
| static constexpr bool | is_valid_transformation_result_type |
A metafunction that checks is Result_Type can be used as the result of transformation method.
A transformation method can return a value of type T or a value of type expected_t<T, error_reason_t>. But a user can define transformation method that returns an expected_t<T, parse_error_t> just by a mistake. That mistake should be detected.
Metafunction is_appropriate_transformer_result_type serves that purpose: it defines value to true if transformation method returns T or expected_t<T, error_reason_t>. In the case of expected_t<T, parse_error_t> value will be set to `false.
template< typename Result_Type > struct is_appropriate_transformer_result_type< expected_t< Result_Type, error_reason_t > > { static constexpr bool value = true; };
template< typename Result_Type > struct is_appropriate_transformer_result_type< expected_t< Result_Type, parse_error_t > > { static constexpr bool value = false; };
transformed_value_producer_traits_checker
/*!
A helper template for checking a possibility to connect a producer with a transformer.
This helper can be seen as a metafunction that defines a boolean value is_valid_transformation_result_type. If that value is true then Transformer::transform method returns allowed type (T or expected_t<T, error_reson_t>).
Definition at line 1147 of file easy_parser.hpp.
| using restinio::easy_parser::impl::transformed_value_producer_traits_checker< Producer, Transformer >::expected_result_t = typename Transformer::result_type |
Definition at line 1163 of file easy_parser.hpp.
| using restinio::easy_parser::impl::transformed_value_producer_traits_checker< Producer, Transformer >::producer_result_t |
Definition at line 1154 of file easy_parser.hpp.
| using restinio::easy_parser::impl::transformed_value_producer_traits_checker< Producer, Transformer >::transformation_result_t |
Definition at line 1158 of file easy_parser.hpp.
|
staticconstexpr |
Definition at line 1165 of file easy_parser.hpp.