Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions adobe/any_regular.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,13 +687,12 @@ inline bool empty(const any_regular_t& x) { return x.type_info() == typeid(empty
template <typename R>
struct runtime_cast_t<R, const any_regular_t> {
R operator()(const any_regular_t& x) const {
typedef typename boost::remove_const<typename boost::remove_reference<R>::type>::type
result_type;
using result_type = std::remove_const_t<std::remove_reference_t<R>>;

static_assert(boost::is_reference<R>::value);
static_assert(std::is_reference_v<R>);

/* There is no auto-promotion through the new interface. Soon promotion will be disabled. */
static_assert(std::is_same<typename promote<result_type>::type, result_type>::value);
static_assert(std::is_same_v<typename promote<result_type>::type, result_type>);

return x.cast<result_type>();
}
Expand All @@ -704,9 +703,9 @@ struct runtime_cast_t<R, const any_regular_t> {
template <typename R>
struct runtime_cast_t<R, any_regular_t> {
R operator()(any_regular_t& x) const {
typedef typename boost::remove_reference<R>::type result_type;
using result_type = std::remove_reference_t<R>;

static_assert(boost::is_reference<R>::value);
static_assert(std::is_reference_v<R>);

/* There is no auto-promotion through the new interface. Soon promotion will be disabled. */
static_assert(std::is_same<typename promote<result_type>::type, result_type>::value);
Expand All @@ -720,9 +719,9 @@ struct runtime_cast_t<R, any_regular_t> {
template <typename R>
struct runtime_cast_t<R, any_regular_t*> {
R operator()(any_regular_t* x) const {
typedef typename boost::remove_pointer<R>::type result_type;
using result_type = std::remove_pointer_t<R>;

static_assert(boost::is_pointer<R>::value);
static_assert(std::is_pointer_v<R>);

/* There is no auto-promotion through the new interface. Soon promotion will be disabled. */
static_assert(std::is_same<typename promote<result_type>::type, result_type>::value);
Expand All @@ -736,13 +735,12 @@ struct runtime_cast_t<R, any_regular_t*> {
template <typename R>
struct runtime_cast_t<R, const any_regular_t*> {
R operator()(const any_regular_t* x) const {
typedef
typename boost::remove_const<typename boost::remove_pointer<R>::type>::type result_type;
using result_type = std::remove_const_t<std::remove_pointer_t<R>>;

static_assert(boost::is_pointer<R>::value);
static_assert(std::is_pointer_v<R>);

/* There is no auto-promotion through the new interface. Soon promotion will be disabled. */
static_assert(std::is_same<typename promote<result_type>::type, result_type>::value);
static_assert(std::is_same_v<typename promote<result_type>::type, result_type>);

if (x->type_info() != typeid(result_type))
return 0;
Expand Down
29 changes: 7 additions & 22 deletions adobe/arg_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#ifndef ADOBE_ARG_STREAM_H
#define ADOBE_ARG_STREAM_H

#include <boost/function_types/function_arity.hpp>
#include <boost/function_types/function_type.hpp>
#include <boost/function_types/result_type.hpp>

#include <boost/mpl/begin.hpp>
#include <boost/mpl/deref.hpp>
Expand Down Expand Up @@ -195,26 +193,13 @@ struct signature<std::function<F>> {
typedef F type;
};

/*!
\ingroup arg_stream

\brief result_type<F>::type is the return type of the function f.

\template_parameters
- \c F models callable object
*/
template <typename F>
struct result_type {
typedef typename boost::function_types::result_type<typename signature<F>::type>::type type;
};

namespace detail {
// how it all works...


template <typename T>
struct remove_cv_ref : boost::remove_cv<typename boost::remove_reference<T>::type> {};

struct remove_cv_ref {
using type = std::remove_cv_t<std::remove_reference_t<T>>;
};

// see also boost::function_types 'interpreter' example
// we convert the function signature into a mpl sequence (it *is* an mpl sequence, since it
Expand All @@ -231,7 +216,7 @@ template <typename F,
struct invoker {
// add an argument to a Fusion cons-list for each parameter type
template <typename Args, typename ArgStream>
static inline typename result_type<F>::type apply(F func, ArgStream& astream,
static inline auto apply(F func, ArgStream& astream,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use decltype(auto) in cases like this? auto will strip references and top-level cv-qualifiers, which may not be what we want here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, lets ask @sean-parent

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the prior semantics, it should be decltype(auto).

Args const& args) {
typedef typename remove_cv_ref<typename boost::mpl::deref<From>::type>::type arg_type;
typedef typename boost::mpl::next<From>::type next_iter_type;
Expand All @@ -245,7 +230,7 @@ struct invoker {
template <typename F, class To>
struct invoker<F, To, To> {
template <typename Args, typename ArgStream>
static inline typename result_type<F>::type apply(F func, ArgStream&, Args const& args) {
static inline auto apply(F func, ArgStream&, Args const& args) {
return boost::fusion::invoke(func, args);
}
};
Expand All @@ -262,7 +247,7 @@ struct invoker<F, To, To> {
abstracted object.
*/
template <typename F, typename ArgStream>
typename result_type<F>::type call(F f, ArgStream& astream) {
auto call(F f, ArgStream& astream) {
return detail::invoker<F>::apply(f, astream, boost::fusion::nil());
}

Expand All @@ -272,7 +257,7 @@ typename result_type<F>::type call(F f, ArgStream& astream) {
\brief specialization of arg_stream::call for handling member function calls.
*/
template <class T, typename F, typename ArgStream>
typename result_type<F>::type call(T* that, F f, ArgStream& astream) {
auto call(T* that, F f, ArgStream& astream) {
// object gets pushed on as first arg of fusion list,
// and remove first arg from signature (the object that the member function belongs to)
// using
Expand Down
36 changes: 0 additions & 36 deletions adobe/cstdint.hpp

This file was deleted.

47 changes: 0 additions & 47 deletions adobe/string_fwd.hpp

This file was deleted.

Loading