Skip to content

Commit 4a83677

Browse files
authored
remove deprecated code and de-boost (#154)
* remove depricated code and de-boost * should be decltype(auto) --------- Co-authored-by: Sasha Nikiforov <nika@>
1 parent 26b88ed commit 4a83677

10 files changed

Lines changed: 29 additions & 716 deletions

File tree

adobe/any_regular.hpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -687,13 +687,12 @@ inline bool empty(const any_regular_t& x) { return x.type_info() == typeid(empty
687687
template <typename R>
688688
struct runtime_cast_t<R, const any_regular_t> {
689689
R operator()(const any_regular_t& x) const {
690-
typedef typename boost::remove_const<typename boost::remove_reference<R>::type>::type
691-
result_type;
690+
using result_type = std::remove_const_t<std::remove_reference_t<R>>;
692691

693-
static_assert(boost::is_reference<R>::value);
692+
static_assert(std::is_reference_v<R>);
694693

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

698697
return x.cast<result_type>();
699698
}
@@ -704,9 +703,9 @@ struct runtime_cast_t<R, const any_regular_t> {
704703
template <typename R>
705704
struct runtime_cast_t<R, any_regular_t> {
706705
R operator()(any_regular_t& x) const {
707-
typedef typename boost::remove_reference<R>::type result_type;
706+
using result_type = std::remove_reference_t<R>;
708707

709-
static_assert(boost::is_reference<R>::value);
708+
static_assert(std::is_reference_v<R>);
710709

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

725-
static_assert(boost::is_pointer<R>::value);
724+
static_assert(std::is_pointer_v<R>);
726725

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

742-
static_assert(boost::is_pointer<R>::value);
740+
static_assert(std::is_pointer_v<R>);
743741

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

747745
if (x->type_info() != typeid(result_type))
748746
return 0;

adobe/arg_stream.hpp

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
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-
211196
namespace detail {
212197
// how it all works...
213198

214-
215199
template <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,
231216
struct 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 {
245230
template <typename F, class To>
246231
struct 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> {
262247
abstracted object.
263248
*/
264249
template <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
*/
274259
template <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

adobe/cstdint.hpp

Lines changed: 0 additions & 36 deletions
This file was deleted.

adobe/string_fwd.hpp

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)