66#ifndef ADOBE_ARG_STREAM_H
77#define ADOBE_ARG_STREAM_H
88
9- #include < boost/function_types/function_arity.hpp>
109#include < boost/function_types/function_type.hpp>
11- #include < boost/function_types/result_type.hpp>
1210
1311#include < boost/mpl/begin.hpp>
1412#include < boost/mpl/deref.hpp>
@@ -195,26 +193,13 @@ struct signature<std::function<F>> {
195193 typedef F type;
196194};
197195
198- /* !
199- \ingroup arg_stream
200-
201- \brief result_type<F>::type is the return type of the function f.
202-
203- \template_parameters
204- - \c F models callable object
205- */
206- template <typename F>
207- struct result_type {
208- typedef typename boost::function_types::result_type<typename signature<F>::type>::type type;
209- };
210-
211196namespace detail {
212197// how it all works...
213198
214-
215199template <typename T>
216- struct remove_cv_ref : boost::remove_cv<typename boost::remove_reference<T>::type> {};
217-
200+ struct remove_cv_ref {
201+ using type = std::remove_cv_t <std::remove_reference_t <T>>;
202+ };
218203
219204// see also boost::function_types 'interpreter' example
220205// we convert the function signature into a mpl sequence (it *is* an mpl sequence, since it
@@ -231,7 +216,7 @@ template <typename F,
231216struct invoker {
232217 // add an argument to a Fusion cons-list for each parameter type
233218 template <typename Args, typename ArgStream>
234- static inline typename result_type<F>::type apply (F func, ArgStream& astream,
219+ static inline decltype ( auto ) apply(F func, ArgStream& astream,
235220 Args const & args) {
236221 typedef typename remove_cv_ref<typename boost::mpl::deref<From>::type>::type arg_type;
237222 typedef typename boost::mpl::next<From>::type next_iter_type;
@@ -245,7 +230,7 @@ struct invoker {
245230template <typename F, class To >
246231struct invoker <F, To, To> {
247232 template <typename Args, typename ArgStream>
248- static inline typename result_type<F>::type apply (F func, ArgStream&, Args const & args) {
233+ static inline decltype ( auto ) apply(F func, ArgStream&, Args const & args) {
249234 return boost::fusion::invoke (func, args);
250235 }
251236};
@@ -262,7 +247,7 @@ struct invoker<F, To, To> {
262247abstracted object.
263248*/
264249template <typename F, typename ArgStream>
265- typename result_type<F>::type call (F f, ArgStream& astream) {
250+ auto call (F f, ArgStream& astream) {
266251 return detail::invoker<F>::apply (f, astream, boost::fusion::nil ());
267252}
268253
@@ -272,7 +257,7 @@ typename result_type<F>::type call(F f, ArgStream& astream) {
272257\brief specialization of arg_stream::call for handling member function calls.
273258*/
274259template <class T , typename F, typename ArgStream>
275- typename result_type<F>::type call (T* that, F f, ArgStream& astream) {
260+ auto call (T* that, F f, ArgStream& astream) {
276261 // object gets pushed on as first arg of fusion list,
277262 // and remove first arg from signature (the object that the member function belongs to)
278263 // using
0 commit comments