Commit bd0d7b98 authored by Dominik Charousset's avatar Dominik Charousset

Replace "typedef" with "using"

parent 870ed47e
......@@ -49,7 +49,7 @@ class execution_unit;
* @brief A unique actor ID.
* @relates abstract_actor
*/
typedef uint32_t actor_id;
using actor_id = uint32_t;
/**
* @brief Denotes an ID that is never used by an actor.
......@@ -60,7 +60,7 @@ class actor;
class abstract_actor;
class response_promise;
typedef intrusive_ptr<abstract_actor> abstract_actor_ptr;
using abstract_actor_ptr = intrusive_ptr<abstract_actor>;
/**
* @brief Base class for all actor implementations.
......@@ -262,8 +262,8 @@ struct functor_attachable : attachable {
template<typename F>
bool abstract_actor::attach_functor(F&& f) {
typedef typename detail::rm_const_and_ref<F>::type f_type;
typedef functor_attachable<f_type> impl;
using f_type = typename detail::rm_const_and_ref<F>::type;
using impl = functor_attachable<f_type>;
return attach(attachable_ptr{new impl(std::forward<F>(f))});
}
......
......@@ -118,8 +118,8 @@ class abstract_group : public abstract_channel {
};
typedef module* module_ptr;
typedef std::unique_ptr<module> unique_module_ptr;
using module_ptr = module*;
using unique_module_ptr = std::unique_ptr<module>;
virtual void serialize(serializer* sink) = 0;
......@@ -160,7 +160,7 @@ class abstract_group : public abstract_channel {
* @brief A smart pointer type that manages instances of {@link group}.
* @relates group
*/
typedef intrusive_ptr<abstract_group> abstract_group_ptr;
using abstract_group_ptr = intrusive_ptr<abstract_group>;
} // namespace cppa
......
......@@ -30,7 +30,7 @@ class accept_handle : public io_handle<accept_handle> {
friend class io_handle<accept_handle>;
typedef io_handle<accept_handle> super;
using super = io_handle<accept_handle>;
public:
......
......@@ -44,13 +44,13 @@ class actor_companion : public extend<local_actor, actor_companion>::
with<behavior_stack_based<behavior>::impl,
mixin::sync_sender<nonblocking_response_handle_tag>::impl> {
typedef detail::shared_spinlock lock_type;
using lock_type = detail::shared_spinlock;
public:
typedef std::unique_ptr<mailbox_element, detail::disposer> message_pointer;
using message_pointer = std::unique_ptr<mailbox_element, detail::disposer>;
typedef std::function<void (message_pointer)> enqueue_handler;
using enqueue_handler = std::function<void (message_pointer)>;
/**
* @brief Removes the handler for incoming messages and terminates
......@@ -81,7 +81,7 @@ class actor_companion : public extend<local_actor, actor_companion>::
* @brief A pointer to a co-existing (actor) object.
* @relates actor_companion
*/
typedef intrusive_ptr<actor_companion> actor_companion_ptr;
using actor_companion_ptr = intrusive_ptr<actor_companion>;
} // namespace cppa
......
......@@ -75,7 +75,7 @@ class actor_namespace {
/**
* @brief A map that stores all proxies for known remote actors.
*/
typedef std::map<actor_id, actor_proxy::anchor_ptr> proxy_map;
using proxy_map = std::map<actor_id, actor_proxy::anchor_ptr>;
/**
* @brief Returns the number of proxies for @p node.
......
......@@ -32,7 +32,7 @@ class actor_ostream {
public:
typedef actor_ostream& (*fun_type)(actor_ostream&);
using fun_type = actor_ostream& (*)(actor_ostream&);
actor_ostream(actor_ostream&&) = default;
actor_ostream(const actor_ostream&) = default;
......
......@@ -42,7 +42,7 @@ using actor_proxy_ptr = intrusive_ptr<actor_proxy>;
*/
class actor_proxy : public abstract_actor {
typedef abstract_actor super;
using super = abstract_actor;
public:
......
......@@ -143,7 +143,7 @@ std::pair<std::pair<GRes (Parent::*)() const, SRes (Parent::*)(SArg)>,
compound_member(
const std::pair<GRes (Parent::*)() const, SRes (Parent::*)(SArg)>& gspair,
const Ts&... args) {
typedef typename detail::rm_const_and_ref<GRes>::type mtype;
using mtype = typename detail::rm_const_and_ref<GRes>::type;
return {gspair, new detail::default_uniform_type_info<mtype>(args...)};
}
......
......@@ -81,7 +81,7 @@ class attachable {
* @brief A managed {@link attachable} pointer.
* @relates attachable
*/
typedef std::unique_ptr<attachable> attachable_ptr;
using attachable_ptr = std::unique_ptr<attachable>;
} // namespace cppa
......
......@@ -44,11 +44,11 @@ class behavior {
public:
typedef std::function<optional<message>(message&)> continuation_fun;
using continuation_fun = std::function<optional<message>(message&)>;
/** @cond PRIVATE */
typedef intrusive_ptr<detail::behavior_impl> impl_ptr;
using impl_ptr = intrusive_ptr<detail::behavior_impl>;
inline auto as_behavior_impl() const -> const impl_ptr&;
......
......@@ -33,8 +33,8 @@ struct is_behavior_policy : std::false_type {};
template<bool DiscardBehavior>
struct is_behavior_policy<behavior_policy<DiscardBehavior>> : std::true_type {};
typedef behavior_policy<false> keep_behavior_t;
typedef behavior_policy<true> discard_behavior_t;
using keep_behavior_t = behavior_policy<false>;
using discard_behavior_t = behavior_policy<true>;
/**
* @brief Policy tag that causes {@link event_based_actor::become} to
......
......@@ -33,22 +33,22 @@ namespace cppa {
template<class Base, class Subtype, class BehaviorType>
class behavior_stack_based_impl : public single_timeout<Base, Subtype> {
typedef single_timeout<Base, Subtype> super;
using super = single_timeout<Base, Subtype>;
public:
/**************************************************************************
* typedefs and constructor *
* types and constructor *
**************************************************************************/
typedef BehaviorType behavior_type;
using behavior_type = BehaviorType;
typedef behavior_stack_based_impl combined_type;
using combined_type = behavior_stack_based_impl;
typedef response_handle<behavior_stack_based_impl,
message,
nonblocking_response_handle_tag>
response_handle_type;
using response_handle_type = response_handle<
behavior_stack_based_impl,
message,
nonblocking_response_handle_tag>;
template<typename... Ts>
behavior_stack_based_impl(Ts&&... vs) : super(std::forward<Ts>(vs)...) { }
......@@ -175,11 +175,11 @@ class behavior_stack_based {
template<class Base, class Subtype>
class impl : public behavior_stack_based_impl<Base, Subtype, BehaviorType> {
typedef behavior_stack_based_impl<Base, Subtype, BehaviorType> super;
using super = behavior_stack_based_impl<Base, Subtype, BehaviorType>;
public:
typedef impl combined_type;
using combined_type = impl;
template<typename... Ts>
impl(Ts&&... args) : super(std::forward<Ts>(args)...) { }
......
......@@ -29,7 +29,7 @@ namespace cppa {
*/
class binary_deserializer : public deserializer {
typedef deserializer super;
using super = deserializer;
public:
......
......@@ -51,7 +51,7 @@ class blocking_actor
/**************************************************************************
* utility stuff and receive() member function family *
**************************************************************************/
typedef std::chrono::high_resolution_clock::time_point timeout_type;
using timeout_type = std::chrono::high_resolution_clock::time_point;
struct receive_while_helper {
......@@ -250,7 +250,7 @@ class blocking_actor::functor_based : public blocking_actor {
public:
typedef std::function<void(blocking_actor*)> act_fun;
using act_fun = std::function<void(blocking_actor*)>;
template<typename F, typename... Ts>
functor_based(F f, Ts&&... vs) {
......
......@@ -30,7 +30,7 @@ class connection_handle : public io_handle<connection_handle> {
friend class io_handle<connection_handle>;
typedef io_handle<connection_handle> super;
using super = io_handle<connection_handle>;
public:
......
......@@ -38,7 +38,7 @@ class continue_helper {
public:
typedef int message_id_wrapper_tag;
using message_id_wrapper_tag = int;
continue_helper(message_id mid, local_actor* self);
......
......@@ -43,11 +43,11 @@ class cow_ptr : util::comparable<cow_ptr<T>>,
public:
typedef T* pointer;
typedef const T* const_pointer;
typedef T element_type;
typedef T& reference;
typedef const T& const_reference;
using pointer = T*;
using const_pointer = const T*;
using element_type = T;
using reference = T&;
using const_reference = const T&;
constexpr cow_ptr() : m_ptr() { }
......
......@@ -58,7 +58,7 @@ class cow_tuple<Head, Tail...> {
public:
typedef detail::type_list<Head, Tail...> types;
using types = detail::type_list<Head, Tail...>;
static constexpr size_t num_elements = sizeof...(Tail) + 1;
......@@ -147,7 +147,7 @@ struct cow_tuple_from_type_list;
template<typename... Ts>
struct cow_tuple_from_type_list< detail::type_list<Ts...>> {
typedef cow_tuple<Ts...> type;
using type = cow_tuple<Ts...>;
};
template<typename T>
......@@ -166,7 +166,7 @@ struct is_cow_tuple<cow_tuple<Ts...>> { static constexpr bool value = true; };
*/
template<size_t N, typename... Ts>
const typename detail::type_at<N, Ts...>::type& get(const cow_tuple<Ts...>& tup) {
typedef typename detail::type_at<N, Ts...>::type result_type;
using result_type = typename detail::type_at<N, Ts...>::type;
return *reinterpret_cast<const result_type*>(tup.at(N));
}
......@@ -181,7 +181,7 @@ const typename detail::type_at<N, Ts...>::type& get(const cow_tuple<Ts...>& tup)
*/
template<size_t N, typename... Ts>
typename detail::type_at<N, Ts...>::type& get_ref(cow_tuple<Ts...>& tup) {
typedef typename detail::type_at<N, Ts...>::type result_type;
using result_type = typename detail::type_at<N, Ts...>::type;
return *reinterpret_cast<result_type*>(tup.mutable_at(N));
}
......
......@@ -20,7 +20,8 @@
#ifndef CPPA_CPPA_HPP
#define CPPA_CPPA_HPP
// this header has been deprecated, forward to new header
// <backward_compatibility version="0.9" whole_file="yes">
#include "cppa/all.hpp"
// </backward_compatibility>
#endif // CPPA_CPPA_HPP
......@@ -20,54 +20,8 @@
#ifndef CPPA_CPPA_FWD_HPP
#define CPPA_CPPA_FWD_HPP
#include <cstdint>
namespace cppa {
// classes
class actor;
class group;
class channel;
class node_id;
class behavior;
class resumable;
class message;
class actor_addr;
class actor_proxy;
class scoped_actor;
class execution_unit;
class abstract_actor;
class abstract_group;
class blocking_actor;
class message_header;
class message_handler;
class uniform_type_info;
class event_based_actor;
class primitive_variant;
// structs
struct anything;
// enums
enum primitive_type : unsigned char;
enum class atom_value : std::uint64_t;
// class templates
template<typename> class optional;
template<typename> class intrusive_ptr;
template<typename> class weak_intrusive_ptr;
// intrusive pointer typedefs
typedef intrusive_ptr<abstract_group> abstract_group_ptr;
typedef intrusive_ptr<actor_proxy> actor_proxy_ptr;
typedef intrusive_ptr<node_id> node_id_ptr;
// weak intrusive pointer typedefs
typedef weak_intrusive_ptr<actor_proxy> weak_actor_proxy_ptr;
// convenience typedefs
typedef const message_header& msg_hdr_cref;
} // namespace cppa
// <backward_compatibility version="0.9" whole_file="yes">
#include "cppa/fwd.hpp"
// </backward_compatibility>
#endif // CPPA_CPPA_FWD_HPP
......@@ -50,7 +50,7 @@ class actor_registry : public singleton_mixin<actor_registry> {
* exit reason. An entry with a nullptr means the actor has finished
* execution for given reason.
*/
typedef std::pair<abstract_actor_ptr, uint32_t> value_type;
using value_type = std::pair<abstract_actor_ptr, uint32_t>;
/**
* @brief Returns the {nullptr, invalid_exit_reason}.
......@@ -82,7 +82,7 @@ class actor_registry : public singleton_mixin<actor_registry> {
private:
typedef std::map<actor_id, value_type> entries;
using entries = std::map<actor_id, value_type>;
std::atomic<size_t> m_running;
std::atomic<actor_id> m_ids;
......
......@@ -46,7 +46,7 @@
namespace cppa {
class message_handler;
typedef optional<message> bhvr_invoke_result;
using bhvr_invoke_result = optional<message>;
} // namespace cppa
......@@ -152,7 +152,7 @@ class behavior_impl : public ref_counted {
virtual void handle_timeout();
inline const duration& timeout() const { return m_timeout; }
typedef intrusive_ptr<behavior_impl> pointer;
using pointer = intrusive_ptr<behavior_impl>;
virtual pointer copy(const generic_timeout_definition& tdef) const = 0;
......@@ -202,7 +202,7 @@ struct dummy_match_expr {
template<class MatchExpr, typename F>
class default_behavior_impl : public behavior_impl {
typedef behavior_impl super;
using super = behavior_impl;
public:
......@@ -256,7 +256,7 @@ default_behavior_impl<dummy_match_expr, F>* new_default_behavior(duration d,
f);
}
typedef intrusive_ptr<behavior_impl> behavior_impl_ptr;
using behavior_impl_ptr = intrusive_ptr<behavior_impl>;
// implemented in message_handler.cpp
// message_handler combine(behavior_impl_ptr, behavior_impl_ptr);
......
......@@ -43,7 +43,7 @@ class behavior_stack {
behavior_stack(const behavior_stack&) = delete;
behavior_stack& operator=(const behavior_stack&) = delete;
typedef std::pair<behavior, message_id> element_type;
using element_type = std::pair<behavior, message_id>;
public:
......
......@@ -27,19 +27,19 @@ namespace detail {
template<typename T>
struct boxed {
typedef detail::wrapped<T> type;
using type = detail::wrapped<T>;
};
template<typename T>
struct boxed<detail::wrapped<T>> {
typedef detail::wrapped<T> type;
using type = detail::wrapped<T>;
};
template<>
struct boxed<anything> {
typedef anything type;
using type = anything;
};
......
......@@ -36,17 +36,17 @@ namespace detail {
class decorated_tuple : public message_data {
typedef message_data super;
using super = message_data;
decorated_tuple& operator=(const decorated_tuple&) = delete;
public:
typedef std::vector<size_t> vector_type;
using vector_type = std::vector<size_t>;
typedef message_data::ptr pointer;
using pointer = message_data::ptr;
typedef const std::type_info* rtti;
using rtti = const std::type_info*;
// creates a dynamically typed subtuple from @p d with an offset
static inline pointer create(pointer d, vector_type v) {
......
......@@ -36,7 +36,7 @@
namespace cppa {
namespace detail {
typedef uniform_type_info_ptr uniform_type_info_ptr;
using uniform_type_info_ptr = uniform_type_info_ptr;
// check if there's a 'push_back' that takes a C::value_type
template<typename T>
......@@ -76,11 +76,11 @@ struct is_stl_pair : std::false_type {};
template<typename F, typename S>
struct is_stl_pair<std::pair<F, S>> : std::true_type {};
typedef std::integral_constant<int, 0> primitive_impl;
typedef std::integral_constant<int, 1> list_impl;
typedef std::integral_constant<int, 2> map_impl;
typedef std::integral_constant<int, 3> pair_impl;
typedef std::integral_constant<int, 9> recursive_impl;
using primitive_impl = std::integral_constant<int, 0>;
using list_impl = std::integral_constant<int, 1>;
using map_impl = std::integral_constant<int, 2>;
using pair_impl = std::integral_constant<int, 3>;
using recursive_impl = std::integral_constant<int, 9>;
template<typename T>
constexpr int impl_id() {
......@@ -95,15 +95,15 @@ constexpr int impl_id() {
template<typename T>
struct deconst_pair {
typedef T type;
using type = T;
};
template<typename K, typename V>
struct deconst_pair<std::pair<K, V>> {
typedef typename std::remove_const<K>::type first_type;
typedef typename std::remove_const<V>::type second_type;
typedef std::pair<first_type, second_type> type;
using first_type = typename std::remove_const<K>::type;
using second_type = typename std::remove_const<V>::type;
using type = std::pair<first_type, second_type>;
};
......@@ -165,7 +165,7 @@ class default_serialize_policy {
template<typename T>
void dimpl(T& storage, deserializer* d, list_impl) const {
typedef typename T::value_type value_type;
using value_type = typename T::value_type;
storage.clear();
size_t size = d->begin_sequence();
for (size_t i = 0; i < size; ++i) {
......@@ -287,7 +287,7 @@ template<typename T, class AccessPolicy, class SerializePolicy>
class member_tinfo<T, AccessPolicy, SerializePolicy, true,
false> : public detail::abstract_uniform_type_info<T> {
typedef typename std::underlying_type<T>::type value_type;
using value_type = typename std::underlying_type<T>::type;
public:
......@@ -349,8 +349,8 @@ class getter_setter_access_policy {
public:
typedef GRes (C::*getter)() const;
typedef SRes (C::*setter)(SArg);
using getter = GRes (C::*)() const;
using setter = SRes (C::*)(SArg);
getter_setter_access_policy(getter g, setter s) : m_get(g), m_set(s) {}
......@@ -396,25 +396,25 @@ struct fake_access_policy {
template<typename T, class C>
uniform_type_info_ptr new_member_tinfo(T C::*memptr) {
typedef memptr_access_policy<T, C> access_policy;
typedef member_tinfo<T, access_policy> result_type;
using access_policy = memptr_access_policy<T, C>;
using result_type = member_tinfo<T, access_policy>;
return uniform_type_info_ptr(new result_type(memptr));
}
template<typename T, class C>
uniform_type_info_ptr new_member_tinfo(T C::*memptr,
uniform_type_info_ptr meminf) {
typedef memptr_access_policy<T, C> access_policy;
typedef member_tinfo<T, access_policy, forwarding_serialize_policy> tinfo;
using access_policy = memptr_access_policy<T, C>;
using tinfo = member_tinfo<T, access_policy, forwarding_serialize_policy>;
return uniform_type_info_ptr(new tinfo(memptr, std::move(meminf)));
}
template<class C, typename GRes, typename SRes, typename SArg>
uniform_type_info_ptr new_member_tinfo(GRes (C::*getter)() const,
SRes (C::*setter)(SArg)) {
typedef getter_setter_access_policy<C, GRes, SRes, SArg> access_policy;
typedef typename detail::rm_const_and_ref<GRes>::type value_type;
typedef member_tinfo<value_type, access_policy> result_type;
using access_policy = getter_setter_access_policy<C, GRes, SRes, SArg>;
using value_type = typename detail::rm_const_and_ref<GRes>::type;
using result_type = member_tinfo<value_type, access_policy>;
return uniform_type_info_ptr(
new result_type(access_policy(getter, setter)));
}
......@@ -423,10 +423,10 @@ template<class C, typename GRes, typename SRes, typename SArg>
uniform_type_info_ptr new_member_tinfo(GRes (C::*getter)() const,
SRes (C::*setter)(SArg),
uniform_type_info_ptr meminf) {
typedef getter_setter_access_policy<C, GRes, SRes, SArg> access_policy;
typedef typename detail::rm_const_and_ref<GRes>::type value_type;
typedef member_tinfo<value_type, access_policy, forwarding_serialize_policy>
tinfo;
using access_policy = getter_setter_access_policy<C, GRes, SRes, SArg>;
using value_type = typename detail::rm_const_and_ref<GRes>::type;
using tinfo = member_tinfo<value_type, access_policy,
forwarding_serialize_policy>;
return uniform_type_info_ptr(
new tinfo(access_policy(getter, setter), std::move(meminf)));
}
......@@ -442,7 +442,7 @@ class default_uniform_type_info : public detail::abstract_uniform_type_info<T> {
}
default_uniform_type_info() {
typedef member_tinfo<T, fake_access_policy<T>> result_type;
using result_type = member_tinfo<T, fake_access_policy<T>>;
m_members.push_back(uniform_type_info_ptr(new result_type));
}
......@@ -535,7 +535,7 @@ class default_uniform_type_info<typed_actor<
public:
typedef typed_actor<Rs...> handle_type;
using handle_type = typed_actor<Rs...>;
default_uniform_type_info() { sub_uti = uniform_typeid<actor>(); }
......
......@@ -50,8 +50,8 @@ class group_manager : public singleton_mixin<group_manager> {
private:
typedef std::map<std::string, abstract_group::unique_module_ptr>
modules_map;
using modules_map = std::map<std::string,
abstract_group::unique_module_ptr>;
modules_map m_mmap;
std::mutex m_mmap_mtx;
......
......@@ -64,8 +64,8 @@ struct ieee_754_trait<uint64_t> : ieee_754_trait<double> {};
template<typename T>
typename ieee_754_trait<T>::packed_type pack754(T f) {
typedef ieee_754_trait<T> trait;
typedef typename trait::packed_type result_type;
using trait = ieee_754_trait<T>;
using result_type = typename trait::packed_type;
// filter special type
if (fabs(f) <= trait::zero) return 0; // only true if f equals +0 or -0
auto significandbits = trait::bits - trait::expbits - 1; // -1 for sign bit
......@@ -103,9 +103,9 @@ typename ieee_754_trait<T>::packed_type pack754(T f) {
template<typename T>
typename ieee_754_trait<T>::float_type unpack754(T i) {
typedef ieee_754_trait<T> trait;
typedef typename trait::signed_packed_type signed_type;
typedef typename trait::float_type result_type;
using trait = ieee_754_trait<T>;
using signed_type = typename trait::signed_packed_type;
using result_type = typename trait::float_type;
if (i == 0) return trait::zero;
auto significandbits = trait::bits - trait::expbits - 1; // -1 for sign bit
// pull the significand
......
......@@ -34,52 +34,46 @@ namespace detail {
template<typename T>
struct implicit_conversions {
typedef typename replace_type<
T,
std::string,
std::is_same<T, const char*>,
std::is_same<T, char*>,
std::is_same<T, char[]>,
is_array_of<T, char>,
is_array_of<T, const char>
>::type
subtype1;
using subtype1 = typename replace_type<
T,
std::string,
std::is_same<T, const char*>,
std::is_same<T, char*>,
std::is_same<T, char[]>,
is_array_of<T, char>,
is_array_of<T, const char>
>::type;
typedef typename replace_type<
subtype1,
std::u16string,
std::is_same<subtype1, const char16_t*>,
std::is_same<subtype1, char16_t*>,
is_array_of<subtype1, char16_t>
>::type
subtype2;
using subtype2 = typename replace_type<
subtype1,
std::u16string,
std::is_same<subtype1, const char16_t*>,
std::is_same<subtype1, char16_t*>,
is_array_of<subtype1, char16_t>
>::type;
typedef typename replace_type<
subtype2,
std::u32string,
std::is_same<subtype2, const char32_t*>,
std::is_same<subtype2, char32_t*>,
is_array_of<subtype2, char32_t>
>::type
subtype3;
using subtype3 = typename replace_type<
subtype2,
std::u32string,
std::is_same<subtype2, const char32_t*>,
std::is_same<subtype2, char32_t*>,
is_array_of<subtype2, char32_t>
>::type;
typedef typename replace_type<
subtype3,
actor,
std::is_convertible<T, abstract_actor*>,
std::is_same<scoped_actor, T>
>::type
type;
using type = typename replace_type<
subtype3,
actor,
std::is_convertible<T, abstract_actor*>,
std::is_same<scoped_actor, T>
>::type;
};
template<typename T>
struct strip_and_convert {
typedef typename implicit_conversions<
typename rm_const_and_ref<T>::type
>::type
type;
using type = typename implicit_conversions<
typename rm_const_and_ref<T>::type
>::type;
};
} // namespace detail
......
......@@ -40,7 +40,7 @@ struct il_right_impl;
template<size_t N, size_t Size>
struct il_right_impl<N, Size> {
typedef int_list<> type;
using type = int_list<>;
};
template<size_t N, size_t Size, long I, long... Is>
......@@ -48,7 +48,7 @@ struct il_right_impl<N, Size, I, Is...> : il_right_impl<N, Size - 1, Is...> { };
template<size_t N, long I, long... Is>
struct il_right_impl<N, N, I, Is...> {
typedef int_list<I, Is...> type;
using type = int_list<I, Is...>;
};
template<class List, size_t N>
......@@ -69,7 +69,7 @@ struct il_indices;
template<template<class...> class List, long... Is, long Pos>
struct il_indices<List<>, Pos, int_list<Is...>> {
typedef int_list<Is...> type;
using type = int_list<Is...>;
};
template<template<class...> class List,
......@@ -79,12 +79,11 @@ template<template<class...> class List,
long... Is>
struct il_indices<List<T0, Ts...>, Pos, int_list<Is...>> {
// always use type_list to forward remaining Ts... arguments
typedef typename il_indices<
type_list<Ts...>,
Pos + 1,
int_list<Is..., Pos>
>::type
type;
using type = typename il_indices<
type_list<Ts...>,
Pos + 1,
int_list<Is..., Pos>
>::type;
};
......
......@@ -29,25 +29,25 @@ namespace detail {
*/
template<typename Left, typename Right>
struct left_or_right {
typedef Left type;
using type = Left;
};
template<typename Right>
struct left_or_right<unit_t, Right> {
typedef Right type;
using type = Right;
};
template<typename Right>
struct left_or_right<unit_t&, Right> {
typedef Right type;
using type = Right;
};
template<typename Right>
struct left_or_right<const unit_t&, Right> {
typedef Right type;
using type = Right;
};
......@@ -56,13 +56,13 @@ struct left_or_right<const unit_t&, Right> {
*/
template<typename Left, typename Right>
struct if_not_left {
typedef unit_t type;
using type = unit_t;
};
template<typename Right>
struct if_not_left<unit_t, Right> {
typedef Right type;
using type = Right;
};
......
......@@ -79,7 +79,7 @@ inline bool has_none(const optional<T>& v, const Ts&... vs) {
template<typename R, typename F>
class lifted_fun_invoker {
typedef typename get_callable_trait<F>::arg_types arg_types;
using arg_types = typename get_callable_trait<F>::arg_types;
static constexpr size_t args = tl_size<arg_types>::value;
......@@ -110,7 +110,7 @@ class lifted_fun_invoker {
template<typename F>
class lifted_fun_invoker<bool, F> {
typedef typename get_callable_trait<F>::arg_types arg_types;
using arg_types = typename get_callable_trait<F>::arg_types;
static constexpr size_t args = tl_size<arg_types>::value;
......@@ -150,19 +150,20 @@ class lifted_fun {
public:
typedef typename get_callable_trait<F>::result_type result_type;
using result_type = typename get_callable_trait<F>::result_type;
// Let F be "R (Ts...)" then lifted_fun<F...> returns optional<R>
// unless R is void in which case bool is returned
typedef typename std::conditional<std::is_same<result_type, void>::value,
bool, optional<result_type>>::type
optional_result_type;
using optional_result_type = typename std::conditional<
std::is_same<result_type, void>::value,
bool, optional<result_type>
>::type;
typedef ListOfProjections projections_list;
using projections_list = ListOfProjections;
typedef typename tl_apply<projections_list, std::tuple>::type projections;
using projections = typename tl_apply<projections_list, std::tuple>::type;
typedef type_list<Args...> arg_types;
using arg_types = type_list<Args...>;
lifted_fun() = default;
......@@ -204,7 +205,7 @@ struct get_lifted_fun;
template<typename F, class ListOfProjections, typename... Ts>
struct get_lifted_fun<F, ListOfProjections, type_list<Ts...>> {
typedef lifted_fun<F, ListOfProjections, Ts...> type;
using type = lifted_fun<F, ListOfProjections, Ts...>;
};
......
......@@ -49,18 +49,18 @@ class limited_vector {
public:
typedef T value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef T* iterator;
typedef const T* const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
using value_type = T;
using size_type = size_t;
using difference_type = ptrdiff_t;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = value_type*;
using const_pointer = const value_type*;
using iterator = T*;
using const_iterator = const T*;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
inline limited_vector() : m_size(0) { }
......
......@@ -241,9 +241,9 @@ struct select_matcher;
template<class Tuple, typename... Ts>
struct select_matcher<Tuple, detail::type_list<Ts...>> {
typedef matcher<get_wildcard_position<detail::type_list<Ts...>>(), Tuple,
Ts...> type;
using type = matcher<get_wildcard_position<detail::type_list<Ts...>>(),
Tuple,
Ts...>;
};
} // namespace detail
......
......@@ -142,7 +142,7 @@ class basic_memory_cache : public memory_cache {
}
}
typedef wrapper* iterator;
using iterator = wrapper*;
iterator begin() { return data; }
......
......@@ -73,7 +73,7 @@ class message_data : public ref_counted {
bool equals(const message_data& other) const;
typedef message_iterator<message_data> const_iterator;
using const_iterator = message_iterator<message_data>;
inline const_iterator begin() const {
return {this};
......
......@@ -32,7 +32,7 @@ namespace detail {
template<typename T>
struct conv_arg_impl {
typedef optional<T> result_type;
using result_type = optional<T>;
static inline result_type _(const std::string& arg) {
std::istringstream iss(arg);
T result;
......@@ -45,7 +45,7 @@ struct conv_arg_impl {
template<>
struct conv_arg_impl<std::string> {
typedef optional<std::string> result_type;
using result_type = optional<std::string>;
static inline result_type _(const std::string& arg) { return arg; }
};
......@@ -64,7 +64,7 @@ class rd_arg_functor {
template<bool> friend class opt1_rvalue_builder;
typedef rd_arg_storage<T> storage_type;
using storage_type = rd_arg_storage<T>;
public:
......@@ -108,8 +108,8 @@ class add_arg_functor {
public:
typedef std::vector<T> value_type;
typedef rd_arg_storage<value_type> storage_type;
using value_type = std::vector<T>;
using storage_type = rd_arg_storage<value_type>;
add_arg_functor(const add_arg_functor&) = default;
......@@ -143,17 +143,17 @@ struct is_rd_arg<rd_arg_functor<T>> : std::true_type { };
template<typename T>
struct is_rd_arg<add_arg_functor<T>> : std::true_type { };
typedef decltype(on<std::string>()) opt0_rvalue_builder;
using opt0_rvalue_builder = decltype(on<std::string>());
template<bool HasShortOpt = true>
class opt1_rvalue_builder {
public:
typedef decltype(on<std::string, std::string>()) left_type;
using left_type = decltype(on<std::string, std::string>());
typedef decltype(on(std::function<optional<std::string>(const std::string&)>()))
right_type;
using right_type = decltype(on(std::function<optional<std::string>
(const std::string&)>()));
template<typename Left, typename Right>
opt1_rvalue_builder(char sopt, std::string lopt, Left&& lhs, Right&& rhs)
......@@ -190,8 +190,8 @@ class opt1_rvalue_builder<false> {
public:
typedef decltype(on(std::function<optional<std::string>(const std::string&)>()))
sub_type;
using sub_type = decltype(on(std::function<optional<std::string>
(const std::string&)>()));
template<typename SubType>
opt1_rvalue_builder(std::string lopt, SubType&& sub)
......
......@@ -78,13 +78,13 @@ class producer_consumer_list {
public:
typedef T value_type;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef const value_type* const_pointer;
using value_type = T;
using size_type = size_t;
using difference_type = ptrdiff_t;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = value_type*;
using const_pointer = const value_type*;
class node {
......
......@@ -21,8 +21,8 @@ template<class Base, class Derived, class Policies>
class proper_actor_base
: public Policies::resume_policy::template mixin<Base, Derived> {
typedef typename Policies::resume_policy::template mixin<Base, Derived>
super;
using super = typename Policies::resume_policy::template mixin<Base,
Derived>;
public:
......@@ -36,7 +36,7 @@ class proper_actor_base
// member functions from scheduling policy
typedef typename Policies::scheduling_policy::timeout_type timeout_type;
using timeout_type = typename Policies::scheduling_policy::timeout_type;
void enqueue(const actor_addr& sender,
message_id mid,
......@@ -84,7 +84,7 @@ class proper_actor_base
priority_policy().push_to_cache(std::move(ptr));
}
typedef typename Policies::priority_policy::cache_iterator cache_iterator;
using cache_iterator = typename Policies::priority_policy::cache_iterator;
inline bool cache_empty() {
return priority_policy().cache_empty();
......@@ -178,7 +178,7 @@ class proper_actor
: public proper_actor_base<Base, proper_actor<Base, Policies, false>,
Policies> {
typedef proper_actor_base<Base, proper_actor, Policies> super;
using super = proper_actor_base<Base, proper_actor, Policies>;
public:
......@@ -230,7 +230,7 @@ class proper_actor<
true> : public proper_actor_base<Base, proper_actor<Base, Policies, true>,
Policies> {
typedef proper_actor_base<Base, proper_actor, Policies> super;
using super = proper_actor_base<Base, proper_actor, Policies>;
public:
......
......@@ -29,8 +29,8 @@ namespace detail {
// tuple-like access to an array of void pointers
template<typename... T>
struct pseudo_tuple {
typedef void* pointer;
typedef const void* const_pointer;
using pointer = void*;
using const_pointer = const void*;
pointer data[sizeof...(T) > 0 ? sizeof...(T) : 1];
......
......@@ -28,19 +28,19 @@ namespace detail {
template<typename T>
struct purge_refs_impl {
typedef T type;
using type = T;
};
template<typename T>
struct purge_refs_impl<std::reference_wrapper<T>> {
typedef T type;
using type = T;
};
template<typename T>
struct purge_refs_impl<std::reference_wrapper<const T>> {
typedef T type;
using type = T;
};
......@@ -49,8 +49,8 @@ struct purge_refs_impl<std::reference_wrapper<const T>> {
*/
template<typename T>
struct purge_refs {
typedef typename purge_refs_impl<
typename detail::rm_const_and_ref<T>::type>::type type;
using type = typename purge_refs_impl<
typename detail::rm_const_and_ref<T>::type>::type;
};
......
......@@ -52,7 +52,7 @@ typename std::enable_if< std::is_floating_point<T>::value
bool
>::type
safe_equal(const T& lhs, const U& rhs) {
typedef decltype(lhs - rhs) res_type;
using res_type = decltype(lhs - rhs);
return std::fabs(lhs - rhs) <= std::numeric_limits<res_type>::epsilon();
}
......
......@@ -65,8 +65,8 @@ class single_reader_queue {
public:
typedef T value_type;
typedef value_type* pointer;
using value_type = T;
using pointer = value_type*;
/**
* @warning call only from the reader (owner)
......
......@@ -29,8 +29,8 @@ namespace cppa {
namespace detail {
struct tuple_dummy {
typedef detail::empty_type_list types;
typedef message_iterator<tuple_dummy> const_iterator;
using types = detail::empty_type_list;
using const_iterator = message_iterator<tuple_dummy>;
inline size_t size() const { return 0; }
inline void* mutable_at(size_t) { return nullptr; }
inline const void* at(size_t) const { return nullptr; }
......
......@@ -57,13 +57,13 @@ class tuple_vals : public message_data {
static_assert(sizeof...(Ts) > 0, "tuple_vals is not allowed to be empty");
typedef message_data super;
using super = message_data;
public:
typedef std::tuple<Ts...> data_type;
using data_type = std::tuple<Ts...>;
typedef types_array<Ts...> element_types;
using element_types = types_array<Ts...>;
tuple_vals(const tuple_vals&) = default;
......
This diff is collapsed.
......@@ -28,14 +28,14 @@ namespace detail {
*/
template<typename First, typename Second>
struct type_pair {
typedef First first;
typedef Second second;
using first = First;
using second = Second;
};
template<typename First, typename Second>
struct to_type_pair {
typedef type_pair<First, Second> type;
using type = type_pair<First, Second>;
};
......
......@@ -42,25 +42,25 @@ namespace detail {
*/
template<typename T>
struct rm_const_and_ref {
typedef T type;
using type = T;
};
template<typename T>
struct rm_const_and_ref<const T&> {
typedef T type;
using type = T;
};
template<typename T>
struct rm_const_and_ref<const T> {
typedef T type;
using type = T;
};
template<typename T>
struct rm_const_and_ref<T&> {
typedef T type;
using type = T;
};
......@@ -119,8 +119,8 @@ struct is_anything : std::is_same<T, anything> {};
*/
template<typename T, typename U>
struct is_array_of {
typedef typename std::remove_all_extents<T>::type step1_type;
typedef typename std::remove_cv<step1_type>::type step2_type;
using step1_type = typename std::remove_all_extents<T>::type;
using step2_type = typename std::remove_cv<step1_type>::type;
static constexpr bool value =
std::is_array<T>::value && std::is_same<step2_type, U>::value;
......@@ -131,19 +131,19 @@ struct is_array_of {
*/
template<typename T0, typename T1>
struct deduce_ref_type {
typedef typename detail::rm_const_and_ref<T1>::type type;
using type = typename detail::rm_const_and_ref<T1>::type;
};
template<typename T0, typename T1>
struct deduce_ref_type<T0&, T1> {
typedef typename detail::rm_const_and_ref<T1>::type& type;
using type = typename detail::rm_const_and_ref<T1>::type&;
};
template<typename T0, typename T1>
struct deduce_ref_type<const T0&, T1> {
typedef const typename detail::rm_const_and_ref<T1>::type& type;
using type = const typename detail::rm_const_and_ref<T1>::type&;
};
......@@ -209,16 +209,16 @@ class is_comparable {
template<typename A, typename B>
static bool cmp_help_fun(const A* arg0, const B* arg1,
decltype(*arg0 == *arg1) * = nullptr) {
decltype(*arg0 == *arg1)* = nullptr) {
return true;
}
template<typename A, typename B>
static void cmp_help_fun(const A*, const B*, void* = nullptr) {}
typedef decltype(cmp_help_fun(static_cast<T1*>(nullptr),
static_cast<T2*>(nullptr),
static_cast<bool*>(nullptr))) result_type;
using result_type = decltype(cmp_help_fun(static_cast<T1*>(nullptr),
static_cast<T2*>(nullptr),
static_cast<bool*>(nullptr)));
public:
......@@ -251,7 +251,7 @@ class is_forward_iterator {
static void sfinae_fun(void*) {}
typedef decltype(sfinae_fun(static_cast<T*>(nullptr))) result_type;
using result_type = decltype(sfinae_fun(static_cast<T*>(nullptr)));
public:
......@@ -283,7 +283,7 @@ class is_iterable {
// SFNINAE default
static void sfinae_fun(const void*) {}
typedef decltype(sfinae_fun(static_cast<const T*>(nullptr))) result_type;
using result_type = decltype(sfinae_fun(static_cast<const T*>(nullptr)));
public:
......@@ -318,13 +318,13 @@ struct is_mutable_ref {
*/
template<typename T>
struct rm_optional {
typedef T type;
using type = T;
};
template<typename T>
struct rm_optional<optional<T>> {
typedef T type;
using type = T;
};
......@@ -343,50 +343,50 @@ struct callable_trait;
// member const function pointer
template<class C, typename Result, typename... Ts>
struct callable_trait<Result (C::*)(Ts...) const> {
typedef Result result_type;
typedef type_list<Ts...> arg_types;
typedef std::function<Result(Ts...)> fun_type;
using result_type = Result;
using arg_types = type_list<Ts...>;
using fun_type = std::function<Result(Ts...)>;
};
// member function pointer
template<class C, typename Result, typename... Ts>
struct callable_trait<Result (C::*)(Ts...)> {
typedef Result result_type;
typedef type_list<Ts...> arg_types;
typedef std::function<Result(Ts...)> fun_type;
using result_type = Result;
using arg_types = type_list<Ts...>;
using fun_type = std::function<Result(Ts...)>;
};
// good ol' function
template<typename Result, typename... Ts>
struct callable_trait<Result(Ts...)> {
typedef Result result_type;
typedef type_list<Ts...> arg_types;
typedef std::function<Result(Ts...)> fun_type;
using result_type = Result;
using arg_types = type_list<Ts...>;
using fun_type = std::function<Result(Ts...)>;
};
// good ol' function pointer
template<typename Result, typename... Ts>
struct callable_trait<Result (*)(Ts...)> {
typedef Result result_type;
typedef type_list<Ts...> arg_types;
typedef std::function<Result(Ts...)> fun_type;
using result_type = Result;
using arg_types = type_list<Ts...>;
using fun_type = std::function<Result(Ts...)>;
};
// matches (IsFun || IsMemberFun)
template<bool IsFun, bool IsMemberFun, typename T>
struct get_callable_trait_helper {
typedef callable_trait<T> type;
using type = callable_trait<T>;
};
// assume functor providing operator()
template<typename C>
struct get_callable_trait_helper<false, false, C> {
typedef callable_trait<decltype(&C::operator())> type;
using type = callable_trait<decltype(&C::operator())>;
};
......@@ -398,18 +398,18 @@ struct get_callable_trait_helper<false, false, C> {
template<typename T>
struct get_callable_trait {
// type without cv qualifiers
typedef typename rm_const_and_ref<T>::type bare_type;
// if type is a function pointer, this typedef identifies the function
typedef typename std::remove_pointer<bare_type>::type signature_type;
typedef typename get_callable_trait_helper <
std::is_function<bare_type>::value ||
std::is_function<signature_type>::value,
std::is_member_function_pointer<bare_type>::value,
bare_type > ::type type;
typedef typename type::result_type result_type;
typedef typename type::arg_types arg_types;
typedef typename type::fun_type fun_type;
using bare_type = typename rm_const_and_ref<T>::type;
// if T is a function pointer, this type identifies the function
using signature_type = typename std::remove_pointer<bare_type>::type;
using type = typename get_callable_trait_helper<
std::is_function<bare_type>::value
|| std::is_function<signature_type>::value,
std::is_member_function_pointer<bare_type>::value,
bare_type
>::type;
using result_type = typename type::result_type;
using arg_types = typename type::arg_types;
using fun_type = typename type::fun_type;
};
/**
......@@ -425,15 +425,16 @@ struct is_callable {
template<typename C>
static bool
_fun(C*, typename callable_trait<decltype(&C::operator())>::result_type* =
nullptr) {
_fun(C*,
typename callable_trait<decltype(&C::operator())>::result_type* = 0) {
return true;
}
static void _fun(void*) {}
static void _fun(void*) { }
using pointer = typename rm_const_and_ref<T>::type*;
typedef decltype(_fun(
static_cast<typename rm_const_and_ref<T>::type*>(nullptr))) result_type;
using result_type = decltype(_fun(static_cast<pointer>(nullptr)));
public:
......@@ -465,14 +466,14 @@ struct is_manipulator {
template<bool IsCallable, typename C>
struct map_to_result_type_impl {
typedef typename get_callable_trait<C>::type trait_type;
typedef typename trait_type::result_type type;
using trait_type = typename get_callable_trait<C>::type;
using type = typename trait_type::result_type;
};
template<typename C>
struct map_to_result_type_impl<false, C> {
typedef unit_t type;
using type = unit_t;
};
......@@ -482,21 +483,20 @@ struct map_to_result_type_impl<false, C> {
*/
template<typename T>
struct map_to_result_type {
typedef typename map_to_result_type_impl<is_callable<T>::value, T>::type
type;
using type = typename map_to_result_type_impl<
is_callable<T>::value,
T
>::type;
};
template<bool DoReplace, typename T1, typename T2>
struct replace_type_impl {
typedef T1 type;
using type = T1;
};
template<typename T1, typename T2>
struct replace_type_impl<true, T1, T2> {
typedef T2 type;
using type = T2;
};
/**
......@@ -505,8 +505,7 @@ struct replace_type_impl<true, T1, T2> {
template<typename What, typename With, typename... IfStmt>
struct replace_type {
static constexpr bool do_replace = disjunction<IfStmt::value...>::value;
typedef typename replace_type_impl<do_replace, What, With>::type type;
using type = typename replace_type_impl<do_replace, What, With>::type;
};
/**
......@@ -517,14 +516,12 @@ struct type_at;
template<size_t N, typename T0, typename... Ts>
struct type_at<N, T0, Ts...> {
typedef typename type_at<N - 1, Ts...>::type type;
using type = typename type_at<N - 1, Ts...>::type;
};
template<typename T0, typename... Ts>
struct type_at<0, T0, Ts...> {
typedef T0 type;
using type = T0;
};
/**
......
......@@ -39,24 +39,30 @@ template<typename R, typename T>
struct deduce_signature_helper;
template<typename R, typename... Ts>
struct deduce_signature_helper<R, detail::type_list<Ts...>> {
typedef typename replies_to<Ts...>::template with<R> type;
struct deduce_signature_helper<R, type_list<Ts...>> {
using type = typename replies_to<Ts...>::template with<R>;
};
template<typename... Rs, typename... Ts>
struct deduce_signature_helper<std::tuple<Rs...>, detail::type_list<Ts...>> {
typedef typename replies_to<Ts...>::template with<Rs...> type;
struct deduce_signature_helper<std::tuple<Rs...>, type_list<Ts...>> {
using type = typename replies_to<Ts...>::template with<Rs...>;
};
template<typename T>
struct deduce_signature {
typedef typename detail::implicit_conversions<typename T::result_type>::type
result_type;
typedef typename detail::tl_map<typename T::arg_types,
detail::rm_const_and_ref>::type arg_types;
typedef typename deduce_signature_helper<result_type, arg_types>::type type;
using result_type = typename implicit_conversions<
typename T::result_type
>::type;
using arg_types = typename tl_map<
typename T::arg_types,
rm_const_and_ref
>::type;
using type = typename deduce_signature_helper<result_type, arg_types>::type;
};
......@@ -72,50 +78,58 @@ struct input_is {
template<typename OutputList, typename F>
inline void assert_types() {
typedef typename detail::tl_map<
typename detail::get_callable_trait<F>::arg_types,
detail::rm_const_and_ref>::type arg_types;
static constexpr size_t fun_args = detail::tl_size<arg_types>::value;
static_assert(fun_args <= detail::tl_size<OutputList>::value,
using arg_types = typename tl_map<
typename get_callable_trait<F>::arg_types,
rm_const_and_ref
>::type;
static constexpr size_t fun_args = tl_size<arg_types>::value;
static_assert(fun_args <= tl_size<OutputList>::value,
"functor takes too much arguments");
typedef typename detail::tl_right<OutputList, fun_args>::type recv_types;
using recv_types = typename tl_right<OutputList, fun_args>::type;
static_assert(std::is_same<arg_types, recv_types>::value,
"wrong functor signature");
}
template<typename T>
struct lifted_result_type {
typedef detail::type_list<typename detail::implicit_conversions<T>::type>
type;
using type = type_list<typename implicit_conversions<T>::type>;
};
template<typename... Ts>
struct lifted_result_type<std::tuple<Ts...>> {
typedef detail::type_list<Ts...> type;
using type = type_list<Ts...>;
};
template<typename T>
struct deduce_output_type_step2 {
typedef T type;
using type = T;
};
template<typename R>
struct deduce_output_type_step2<detail::type_list<typed_continue_helper<R>>> {
typedef typename lifted_result_type<R>::type type;
struct deduce_output_type_step2<type_list<typed_continue_helper<R>>> {
using type = typename lifted_result_type<R>::type;
};
template<typename Signatures, typename InputTypes>
struct deduce_output_type {
static constexpr int input_pos = detail::tl_find_if<
Signatures, input_is<InputTypes>::template eval>::value;
static constexpr int input_pos = tl_find_if<
Signatures,
input_is<InputTypes>::template eval
>::value;
static_assert(input_pos >= 0, "typed actor does not support given input");
typedef typename detail::tl_at<Signatures, input_pos>::type signature;
typedef typename deduce_output_type_step2<
typename signature::output_types>::type type;
using signature = typename tl_at<Signatures, input_pos>::type;
using type = typename deduce_output_type_step2<
typename signature::output_types
>::type;
};
......
......@@ -92,7 +92,7 @@ struct types_array_impl {
inline const uniform_type_info* operator[](size_t p) const {
return data[p];
}
typedef const uniform_type_info* const* const_iterator;
using const_iterator = const uniform_type_info* const*;
inline const_iterator begin() const { return std::begin(data); }
inline const_iterator end() const { return std::end(data); }
};
......@@ -109,10 +109,9 @@ struct types_array_impl<false, T...> {
mutable std::atomic<const uniform_type_info**> pairs;
// pairs[sizeof...(T)];
types_array_impl()
: tinfo_data{ta_util<std_tinf, detail::is_builtin<T>::value,
T>::get()...} {
: tinfo_data{ta_util<std_tinf, is_builtin<T>::value, T>::get()...} {
bool static_init[sizeof...(T)] = {!std::is_same<T, anything>::value &&
detail::is_builtin<T>::value...};
is_builtin<T>::value...};
for (size_t i = 0; i < sizeof...(T); ++i) {
if (static_init[i]) {
data[i].store(uniform_typeid(*(tinfo_data[i])),
......@@ -131,7 +130,7 @@ struct types_array_impl<false, T...> {
}
return result;
}
typedef const uniform_type_info* const* const_iterator;
using const_iterator = const uniform_type_info* const*;
inline const_iterator begin() const {
auto result = pairs.load();
if (result == nullptr) {
......@@ -157,14 +156,16 @@ struct types_array_impl<false, T...> {
template<typename... T>
struct types_array
: types_array_impl<
detail::tl_forall<detail::type_list<T...>, detail::is_builtin>::value,
tl_forall<type_list<T...>, is_builtin>::value,
T...> {
static constexpr size_t size = sizeof...(T);
typedef detail::type_list<T...> types;
typedef typename detail::tl_filter_not<types, detail::is_anything>::type
filtered_types;
using types = type_list<T...>;
using filtered_types = typename tl_filter_not<
types,
is_anything
>::type;
static constexpr size_t filtered_size =
detail::tl_size<filtered_types>::value;
tl_size<filtered_types>::value;
inline bool has_values() const { return false; }
};
......@@ -182,8 +183,8 @@ template<typename TypeList>
struct static_types_array_from_type_list;
template<typename... T>
struct static_types_array_from_type_list<detail::type_list<T...>> {
typedef static_types_array<T...> type;
struct static_types_array_from_type_list<type_list<T...>> {
using type = static_types_array<T...>;
};
......@@ -194,12 +195,12 @@ template<typename T>
struct static_type_list<T> {
static const std::type_info* list;
static inline const std::type_info* by_offset(size_t offset) {
return offset == 0 ? list : &typeid(detail::type_list<>);
return offset == 0 ? list : &typeid(type_list<>);
}
};
template<typename T>
const std::type_info* static_type_list<T>::list = &typeid(detail::type_list<T>);
const std::type_info* static_type_list<T>::list = &typeid(type_list<T>);
// utility for singleton-like access to a type_info instance of a type_list
template<typename T0, typename T1, typename... Ts>
......@@ -212,7 +213,7 @@ struct static_type_list<T0, T1, Ts...> {
template<typename T0, typename T1, typename... Ts>
const std::type_info* static_type_list<T0, T1, Ts...>::list =
&typeid(detail::type_list<T0, T1, Ts...>);
&typeid(type_list<T0, T1, Ts...>);
} // namespace detail
} // namespace cppa
......
......@@ -28,31 +28,31 @@ namespace detail {
template<typename T>
struct unboxed {
typedef T type;
using type = T;
};
template<typename T>
struct unboxed<detail::wrapped<T>> {
typedef typename detail::wrapped<T>::type type;
using type = typename detail::wrapped<T>::type;
};
template<typename T>
struct unboxed<detail::wrapped<T>(&)()> {
typedef typename detail::wrapped<T>::type type;
using type = typename detail::wrapped<T>::type;
};
template<typename T>
struct unboxed<detail::wrapped<T>()> {
typedef typename detail::wrapped<T>::type type;
using type = typename detail::wrapped<T>::type;
};
template<typename T>
struct unboxed<detail::wrapped<T>(*)()> {
typedef typename detail::wrapped<T>::type type;
using type = typename detail::wrapped<T>::type;
};
......
......@@ -73,7 +73,7 @@ class uniform_type_info_map {
public:
typedef const uniform_type_info* pointer;
using pointer = const uniform_type_info*;
virtual ~uniform_type_info_map();
......
......@@ -28,13 +28,13 @@ namespace detail {
*/
template<typename T>
struct wrapped {
typedef T type;
using type = T;
};
template<typename T>
struct wrapped<wrapped<T>> {
typedef typename wrapped<T>::type type;
using type = typename wrapped<T>::type;
};
......
......@@ -28,7 +28,7 @@ struct extend_helper;
template<class D, class B>
struct extend_helper<D, B> {
typedef B type;
using type = B;
};
......
......@@ -55,9 +55,9 @@ struct invalid_actor_addr_t;
enum primitive_type : unsigned char;
enum class atom_value : uint64_t;
// intrusive pointer typedefs
typedef intrusive_ptr<abstract_group> abstract_group_ptr;
typedef intrusive_ptr<actor_proxy> actor_proxy_ptr;
// intrusive pointer types
using abstract_group_ptr = intrusive_ptr<abstract_group>;
using actor_proxy_ptr = intrusive_ptr<actor_proxy>;
// functions
template<typename T, typename U>
......
......@@ -40,11 +40,11 @@ class intrusive_ptr : detail::comparable<intrusive_ptr<T>>,
public:
typedef T* pointer;
typedef const T* const_pointer;
typedef T element_type;
typedef T& reference;
typedef const T& const_reference;
using pointer = T* ;
using const_pointer = const T*;
using element_type = T ;
using reference = T& ;
using const_reference = const T&;
constexpr intrusive_ptr() : m_ptr(nullptr) { }
......
......@@ -55,7 +55,7 @@ class broker : public extend<local_actor>::
friend class policy::sequential_invoke;
typedef combined_type super;
using super = combined_type;
public:
......@@ -219,8 +219,7 @@ class broker : public extend<local_actor>::
actor fork(F fun, connection_handle hdl, Ts&&... vs) {
// provoke compile-time errors early
using fun_res = decltype(fun(this, hdl, std::forward<Ts>(vs)...));
// this static assert only prevents a warning about
// unused local typedef
// prevent warning about unused local type
static_assert(std::is_same<fun_res, fun_res>::value,
"your compiler is lying to you");
auto i = m_scribes.find(hdl);
......@@ -346,7 +345,7 @@ class broker : public extend<local_actor>::
static broker_ptr from(F fun) {
// transform to STD function here, because GCC is unable
// to select proper overload otherwise ...
typedef decltype(fun((broker*)nullptr)) fres;
using fres = decltype(fun((broker*)nullptr));
std::function<fres(broker*)> stdfun{std::move(fun)};
return from_impl(std::move(stdfun));
}
......@@ -399,9 +398,9 @@ class broker : public extend<local_actor>::
void cleanup(uint32_t reason) override;
typedef intrusive_ptr<scribe> scribe_pointer;
using scribe_pointer = intrusive_ptr<scribe>;
typedef intrusive_ptr<doorman> doorman_pointer;
using doorman_pointer = intrusive_ptr<doorman>;
bool initialized() const;
......
......@@ -95,11 +95,11 @@ namespace network {
// some more annoying platform-dependent bootstrapping
#ifdef CPPA_WINDOWS
typedef SOCKET native_socket_t;
typedef const char* setsockopt_ptr;
typedef const char* socket_send_ptr;
typedef char* socket_recv_ptr;
typedef int socklen_t;
using native_socket_t = SOCKET;
using setsockopt_ptr = const char*;
using socket_send_ptr = const char*;
using socket_recv_ptr = char*;
using socklen_t = int;
constexpr native_socket_t invalid_socket = INVALID_SOCKET;
inline int last_socket_error() { return WSAGetLastError(); }
inline bool would_block_or_temporarily_unavailable(int errcode) {
......@@ -108,10 +108,10 @@ namespace network {
constexpr int ec_out_of_memory = WSAENOBUFS;
constexpr int ec_interrupted_syscall = WSAEINTR;
#else
typedef int native_socket_t;
typedef const void* setsockopt_ptr;
typedef const void* socket_send_ptr;
typedef void* socket_recv_ptr;
using native_socket_t = int;
using setsockopt_ptr = const void*;
using socket_send_ptr = const void*;
using socket_recv_ptr = void*;
constexpr native_socket_t invalid_socket = -1;
inline void closesocket(native_socket_t fd) { close(fd); }
inline int last_socket_error() { return errno; }
......
......@@ -46,7 +46,7 @@ class sync_request_info : public extend<memory_managed>::
public:
typedef sync_request_info* pointer;
using pointer = sync_request_info*;
~sync_request_info();
......@@ -62,7 +62,7 @@ class sync_request_info : public extend<memory_managed>::
class remote_actor_proxy : public actor_proxy {
typedef actor_proxy super;
using super = actor_proxy;
public:
......
......@@ -49,7 +49,7 @@ actor spawn_io_client(F fun, const std::string& host,
auto hdl = network::conn_hdl_from_socket(sock);
// provoke compiler error early
using fun_res = decltype(fun((broker*) 0, hdl, std::forward<Ts>(args)...));
// prevent warning about unused local typedef
// prevent warning about unused local type
static_assert(std::is_same<fun_res, fun_res>::value,
"your compiler is lying to you");
return spawn_class<broker::functor_based>(
......
......@@ -36,7 +36,7 @@ struct typed_remote_actor_helper;
template<typename... Ts>
struct typed_remote_actor_helper<detail::type_list<Ts...>> {
typedef typed_actor<Ts...> return_type;
using return_type = typed_actor<Ts...>;
template<typename... Vs>
return_type operator()(Vs&&... vs) {
auto iface = return_type::get_interface();
......
......@@ -59,13 +59,13 @@ class sync_handle_helper;
*/
class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
typedef combined_type super;
using super = combined_type;
public:
typedef detail::disposer del;
using del = detail::disposer;
typedef detail::single_reader_queue<mailbox_element, del> mailbox_type;
using mailbox_type = detail::single_reader_queue<mailbox_element, del>;
~local_actor();
......@@ -546,7 +546,7 @@ class local_actor : public extend<abstract_actor>::with<mixin::memory_cached> {
* @brief A smart pointer to a {@link local_actor} instance.
* @relates local_actor
*/
typedef intrusive_ptr<local_actor> local_actor_ptr;
using local_actor_ptr = intrusive_ptr<local_actor>;
/******************************************************************************
* inline and template member function implementations *
......
......@@ -31,7 +31,7 @@ namespace cppa {
template<class Base, class Subtype>
class mailbox_based : public Base {
typedef detail::disposer del;
using del = detail::disposer;
public:
......@@ -55,9 +55,9 @@ class mailbox_based : public Base {
protected:
typedef mailbox_based combined_type;
using combined_type = mailbox_based;
typedef detail::single_reader_queue<mailbox_element, del> mailbox_type;
using mailbox_type = detail::single_reader_queue<mailbox_element, del>;
template<typename... Ts>
mailbox_based(Ts&&... args) : Base(std::forward<Ts>(args)...) { }
......
......@@ -34,8 +34,8 @@ namespace cppa {
class local_actor;
class mailbox_element
: public extend<memory_managed>::with<mixin::memory_cached> {
class mailbox_element : public extend<memory_managed>::
with<mixin::memory_cached> {
friend class local_actor;
friend class detail::memory;
......@@ -69,8 +69,10 @@ class mailbox_element
};
typedef std::unique_ptr<mailbox_element, detail::disposer>
unique_mailbox_element_pointer;
using unique_mailbox_element_pointer = std::unique_ptr<
mailbox_element,
detail::disposer
>;
} // namespace cppa
......
This diff is collapsed.
......@@ -47,17 +47,17 @@ class message {
/**
* @brief A raw pointer to the data.
*/
typedef detail::message_data* raw_ptr;
using raw_ptr = detail::message_data*;
/**
* @brief A (COW) smart pointer to the data.
*/
typedef detail::message_data::ptr data_ptr;
using data_ptr = detail::message_data::ptr;
/**
* @brief An iterator to access each element as <tt>const void*</tt>.
*/
typedef detail::message_data::const_iterator const_iterator;
using const_iterator = detail::message_data::const_iterator;
/**
* @brief Creates an empty tuple.
......@@ -247,8 +247,8 @@ typename std::enable_if<
message>::type
make_message(T&& arg, Ts&&... args) {
using namespace detail;
typedef tuple_vals<typename strip_and_convert<T>::type,
typename strip_and_convert<Ts>::type...> data;
using data = tuple_vals<typename strip_and_convert<T>::type,
typename strip_and_convert<Ts>::type...>;
auto ptr = new data(std::forward<T>(arg), std::forward<Ts>(args)...);
return message{detail::message_data::ptr{ptr}};
}
......
......@@ -124,7 +124,7 @@ class message_builder {
template<typename T>
message_builder&
append_impl(typename detail::implicit_conversions<T>::type what) {
typedef decltype(what) type;
using type = decltype(what);
auto uti = uniform_typeid<type>();
auto uval = uti->create();
*reinterpret_cast<type*>(uval->val) = std::move(what);
......
......@@ -54,7 +54,7 @@ class message_handler {
/** @cond PRIVATE */
typedef intrusive_ptr<detail::behavior_impl> impl_ptr;
using impl_ptr = intrusive_ptr<detail::behavior_impl>;
inline auto as_behavior_impl() const -> impl_ptr;
......
......@@ -34,21 +34,23 @@ namespace mixin {
template<class Base, class Subtype, class BehaviorType>
class behavior_stack_based_impl : public single_timeout<Base, Subtype> {
typedef single_timeout<Base, Subtype> super;
using super = single_timeout<Base, Subtype>;
public:
/**************************************************************************
* typedefs and constructor *
* types and constructor *
**************************************************************************/
typedef BehaviorType behavior_type;
using behavior_type = BehaviorType;
typedef behavior_stack_based_impl combined_type;
using combined_type = behavior_stack_based_impl;
typedef response_handle<behavior_stack_based_impl, message,
nonblocking_response_handle_tag>
response_handle_type;
using response_handle_type = response_handle<
behavior_stack_based_impl,
message,
nonblocking_response_handle_tag
>;
template<typename... Ts>
behavior_stack_based_impl(Ts&&... vs)
......@@ -158,11 +160,11 @@ class behavior_stack_based {
template<class Base, class Subtype>
class impl : public behavior_stack_based_impl<Base, Subtype, BehaviorType> {
typedef behavior_stack_based_impl<Base, Subtype, BehaviorType> super;
using super = behavior_stack_based_impl<Base, Subtype, BehaviorType>;
public:
typedef impl combined_type;
using combined_type = impl;
template<typename... Ts>
impl(Ts&&... args)
......
......@@ -37,9 +37,9 @@ class functor_based : public Base {
template<typename F, typename... Ts>
functor_based(F f, Ts&&... vs) {
typedef typename detail::get_callable_trait<F>::type trait;
typedef typename trait::arg_types arg_types;
typedef typename trait::result_type result_type;
using trait = typename detail::get_callable_trait<F>::type;
using arg_types = typename trait::arg_types;
using result_type = typename trait::result_type;
constexpr bool returns_behavior =
std::is_convertible<result_type, behavior>::value;
constexpr bool uses_first_arg = std::is_same<
......
......@@ -32,7 +32,7 @@ namespace mixin {
template<class Base, class Subtype>
class mailbox_based : public Base {
typedef detail::disposer del;
using del = detail::disposer;
public:
......@@ -56,9 +56,9 @@ class mailbox_based : public Base {
protected:
typedef mailbox_based combined_type;
using combined_type = mailbox_based;
typedef detail::single_reader_queue<mailbox_element, del> mailbox_type;
using mailbox_type = detail::single_reader_queue<mailbox_element, del>;
template<typename... Ts>
mailbox_based(Ts&&... args)
......
......@@ -41,7 +41,7 @@ class memory_cached : public Base {
protected:
typedef memory_cached combined_type;
using combined_type = memory_cached;
public:
......
......@@ -32,11 +32,11 @@ namespace mixin {
template<class Base, class Subtype>
class single_timeout : public Base {
typedef Base super;
using super = Base;
public:
typedef single_timeout combined_type;
using combined_type = single_timeout;
template<typename... Ts>
single_timeout(Ts&&... args)
......
......@@ -35,8 +35,11 @@ class sync_sender_impl : public Base {
public:
typedef response_handle<Subtype, message, ResponseHandleTag>
response_handle_type;
using response_handle_type = response_handle<
Subtype,
message,
ResponseHandleTag
>;
/**************************************************************************
* sync_send[_tuple](actor, ...) *
......
......@@ -74,7 +74,7 @@ class node_id : detail::comparable<node_id>,
/**
* @brief Represents a 160 bit hash.
*/
typedef std::array<uint8_t, host_id_size> host_id_type;
using host_id_type = std::array<uint8_t, host_id_size>;
/**
* @brief A reference counted container for host ID and process ID.
......
......@@ -47,13 +47,13 @@ namespace detail {
template<bool IsFun, typename T>
struct add_ptr_to_fun_ {
typedef T* type;
using type = T*;
};
template<typename T>
struct add_ptr_to_fun_<false, T> {
typedef T type;
using type = T;
};
......@@ -62,13 +62,13 @@ struct add_ptr_to_fun : add_ptr_to_fun_<std::is_function<T>::value, T> {};
template<bool ToVoid, typename T>
struct to_void_impl {
typedef unit_t type;
using type = unit_t;
};
template<typename T>
struct to_void_impl<false, T> {
typedef typename add_ptr_to_fun<T>::type type;
using type = typename add_ptr_to_fun<T>::type;
};
......@@ -137,13 +137,15 @@ struct tuple_maker {
template<class Transformers, class Pattern>
struct rvalue_builder {
typedef typename detail::tl_back<Pattern>::type back_type;
using back_type = typename detail::tl_back<Pattern>::type;
static constexpr bool is_complete =
!std::is_same<detail::arg_match_t, back_type>::value;
typedef typename detail::tl_apply<Transformers, std::tuple>::type
fun_container;
using fun_container = typename detail::tl_apply<
Transformers,
std::tuple
>::type;
fun_container m_funs;
......@@ -161,11 +163,15 @@ struct rvalue_builder {
match_expr<
typename get_case<is_complete, Expr, Transformers, Pattern>::type>
operator>>(Expr expr) const {
typedef typename get_case<is_complete, Expr, Transformers,
Pattern>::type lifted_expr;
using lifted_expr = typename get_case<
is_complete,
Expr,
Transformers,
Pattern
>::type;
// adjust m_funs to exactly match expected projections in match case
typedef typename lifted_expr::projections_list target;
typedef typename tl_trim<Transformers>::type trimmed_projections;
using target = typename lifted_expr::projections_list;
using trimmed_projections = typename tl_trim<Transformers>::type;
tuple_maker f;
auto lhs = apply_args(f, get_indices(trimmed_projections{}), m_funs);
typename tl_apply<
......@@ -186,26 +192,28 @@ struct rvalue_builder {
template<bool IsCallable, typename T>
struct pattern_type_ {
typedef detail::get_callable_trait<T> ctrait;
typedef typename ctrait::arg_types args;
using ctrait = detail::get_callable_trait<T>;
using args = typename ctrait::arg_types;
static_assert(detail::tl_size<args>::value == 1,
"only unary functions allowed");
typedef typename detail::rm_const_and_ref<
typename detail::tl_head<args>::type>::type type;
using type = typename detail::rm_const_and_ref<
typename detail::tl_head<args>::type
>::type;
};
template<typename T>
struct pattern_type_<false, T> {
typedef typename implicit_conversions<typename detail::rm_const_and_ref<
typename detail::unboxed<T>::type>::type>::type type;
using type = typename implicit_conversions<
typename detail::rm_const_and_ref<
typename detail::unboxed<T>::type
>::type
>::type;
};
template<typename T>
struct pattern_type
: pattern_type_<
detail::is_callable<T>::value && !detail::is_boxed<T>::value, T> {};
detail::is_callable<T>::value && !detail::is_boxed<T>::value, T> { };
} // namespace detail
} // namespace cppa
......@@ -283,7 +291,7 @@ constexpr typename detail::boxed<T>::type val() {
return typename detail::boxed<T>::type();
}
typedef typename detail::boxed<detail::arg_match_t>::type boxed_arg_match_t;
using boxed_arg_match_t = typename detail::boxed<detail::arg_match_t>::type;
constexpr boxed_arg_match_t arg_match = boxed_arg_match_t();
......@@ -330,14 +338,17 @@ struct is_optional<optional<T>> : std::true_type {};
template<typename T>
struct to_guard<T, true> {
typedef typename detail::get_callable_trait<T>::type ct;
typedef typename ct::arg_types arg_types;
using ct = typename detail::get_callable_trait<T>::type;
using arg_types = typename ct::arg_types;
static_assert(detail::tl_size<arg_types>::value == 1,
"projection/guard must take exactly one argument");
static_assert(is_optional<typename ct::result_type>::value,
"projection/guard must return an optional value");
typedef typename std::conditional<std::is_function<T>::value, T*, T>::type
value_type;
using value_type = typename std::conditional<
std::is_function<T>::value,
T*,
T
>::type;
static value_type _(value_type val) { return val; }
};
......@@ -414,8 +425,12 @@ class on_the_fly_rvalue_builder {
match_expr<typename get_case<false, Expr, detail::empty_type_list,
detail::empty_type_list>::type>
operator>>(Expr expr) const {
typedef typename get_case<false, Expr, detail::empty_type_list,
detail::empty_type_list>::type result_type;
using result_type = typename get_case<
false,
Expr,
detail::empty_type_list,
detail::empty_type_list
>::type;
return result_type{std::move(expr)};
}
......
......@@ -39,13 +39,13 @@ namespace detail {
// converts C arrays, i.e., pointers, to vectors
template<typename T>
struct carr_to_vec {
typedef T type;
using type = T;
};
template<typename T>
struct carr_to_vec<T*> {
typedef std::vector<T> type;
using type = std::vector<T>;
};
......@@ -146,8 +146,8 @@ spawn_cl(const opencl::program& prog, const char* fname, MapArgs map_args,
const opencl::dim_vec& offset = {},
const opencl::dim_vec& local_dims = {}, size_t result_size = 0) {
using std::move;
typedef typename util::get_callable_trait<MapArgs>::fun_type f0;
typedef typename util::get_callable_trait<MapResult>::fun_type f1;
using f0 = typename util::get_callable_trait<MapArgs>::fun_type;
using f1 = typename util::get_callable_trait<MapResult>::fun_type;
detail::cl_spawn_helper<f0, f1> f;
return f(f0{move(map_args)}, f1{move(map_result)}, prog, fname, dims,
offset, local_dims, result_size);
......
......@@ -68,11 +68,10 @@ class actor_facade<Ret(Args...)> : public abstract_actor {
public:
typedef cow_tuple<typename detail::rm_const_and_ref<Args>::type...>
args_tuple;
using args_tuple = cow_tuple<typename detail::rm_const_and_ref<Args>::type...>;
typedef std::function<optional<args_tuple>(message)> arg_mapping;
typedef std::function<message(Ret&)> result_mapping;
using arg_mapping = std::function<optional<args_tuple>(message)>;
using result_mapping = std::function<message(Ret&)>;
static intrusive_ptr<actor_facade>
create(const program& prog, const char* kernel_name,
......
......@@ -48,7 +48,7 @@ namespace opencl {
/**
* @brief A vector of up to three elements used for OpenCL dimensions.
*/
typedef detail::limited_vector<size_t, 3> dim_vec;
using dim_vec = detail::limited_vector<size_t, 3>;
std::string get_opencl_error(cl_int err);
......
......@@ -42,12 +42,12 @@ namespace opencl {
template<typename T, cl_int (*ref)(T), cl_int (*deref)(T)>
class smart_ptr {
typedef typename std::remove_pointer<T>::type element_type;
using element_type = typename std::remove_pointer<T>::type;
typedef element_type* pointer;
typedef element_type& reference;
typedef const element_type* const_pointer;
typedef const element_type& const_reference;
using pointer = element_type* ;
using reference = element_type& ;
using const_pointer = const element_type*;
using const_reference = const element_type&;
public:
......@@ -110,11 +110,11 @@ class smart_ptr {
};
typedef smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject> mem_ptr;
typedef smart_ptr<cl_event, clRetainEvent, clReleaseEvent> event_ptr;
typedef smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel> kernel_ptr;
typedef smart_ptr<cl_context, clRetainContext, clReleaseContext> context_ptr;
typedef smart_ptr<cl_program, clRetainProgram, clReleaseProgram> program_ptr;
using mem_ptr = smart_ptr<cl_mem, clRetainMemObject, clReleaseMemObject>;
using event_ptr = smart_ptr<cl_event, clRetainEvent, clReleaseEvent> ;
using kernel_ptr = smart_ptr<cl_kernel, clRetainKernel, clReleaseKernel> ;
using context_ptr = smart_ptr<cl_context, clRetainContext, clReleaseContext>;
using program_ptr = smart_ptr<cl_program, clRetainProgram, clReleaseProgram>;
typedef smart_ptr<cl_device_id, clRetainDeviceDummy, clReleaseDeviceDummy>
device_ptr;
typedef smart_ptr<cl_command_queue, clRetainCommandQueue, clReleaseCommandQueue>
......
......@@ -40,7 +40,7 @@ class optional {
/**
* @brief Typdef for @p T.
*/
typedef T type;
using type = T;
/* *
* @brief Default constructor.
......@@ -199,7 +199,7 @@ class optional<T&> {
public:
typedef T type;
using type = T;
optional(const none_t& = none) : m_value(nullptr) { }
......
......@@ -66,10 +66,17 @@ struct option_info {
/**
* @brief Stores a help text for program options with option groups.
*/
typedef std::map<std::string, std::map<std::pair<char, std::string>, option_info>>
options_description;
using opt_rvalue_builder = decltype(on(std::function<optional<std::string> (const std::string&)>{}) || on(std::string{}, val<std::string>));
using options_description = std::map<
std::string,
std::map<
std::pair<char, std::string>,
option_info
>
>;
using opt_rvalue_builder = decltype( on(std::function<optional<std::string>
(const std::string&)>{})
|| on(std::string{}, val<std::string>));
using opt0_rvalue_builder = decltype(on(std::string{}) || on(std::string{}));
......
......@@ -60,7 +60,7 @@ enum handle_message_result {
template<receive_policy_flag X>
struct rp_flag {
typedef std::integral_constant<receive_policy_flag, X> type;
using type = std::integral_constant<receive_policy_flag, X>;
};
/**
......@@ -103,9 +103,9 @@ class invoke_policy {
return result;
}
typedef typename rp_flag<rp_nestable>::type nestable;
using nestable = typename rp_flag<rp_nestable>::type;
typedef typename rp_flag<rp_sequential>::type sequential;
using sequential = typename rp_flag<rp_sequential>::type;
private:
......
......@@ -42,7 +42,7 @@ class middleman_scheduling {
public:
typedef intrusive_ptr<Actor> pointer;
using pointer = intrusive_ptr<Actor>;
continuation(pointer ptr, msg_hdr_cref hdr, message&& msg)
: m_self(std::move(ptr)), m_hdr(hdr), m_data(std::move(msg)) { }
......
......@@ -41,11 +41,11 @@ namespace policy {
class no_scheduling {
typedef std::unique_lock<std::mutex> lock_type;
using lock_type = std::unique_lock<std::mutex>;
public:
typedef std::chrono::high_resolution_clock::time_point timeout_type;
using timeout_type = std::chrono::high_resolution_clock::time_point;
template<class Actor>
void enqueue(Actor* self, const actor_addr& sender, message_id mid,
......
......@@ -33,9 +33,9 @@ class not_prioritizing {
public:
typedef std::list<unique_mailbox_element_pointer> cache_type;
using cache_type = std::list<unique_mailbox_element_pointer>;
typedef cache_type::iterator cache_iterator;
using cache_iterator = cache_type::iterator;
template<class Actor>
unique_mailbox_element_pointer next_message(Actor* self) {
......
......@@ -28,10 +28,10 @@ class policies {
public:
typedef SchedulingPolicy scheduling_policy;
typedef PriorityPolicy priority_policy;
typedef ResumePolicy resume_policy;
typedef InvokePolicy invoke_policy;
using scheduling_policy = SchedulingPolicy;
using priority_policy = PriorityPolicy;
using resume_policy = ResumePolicy;
using invoke_policy = InvokePolicy;
scheduling_policy& get_scheduling_policy() { return m_scheduling_policy; }
......
......@@ -33,9 +33,9 @@ class prioritizing {
public:
typedef std::list<unique_mailbox_element_pointer> cache_type;
using cache_type = std::list<unique_mailbox_element_pointer>;
typedef cache_type::iterator cache_iterator;
using cache_iterator = cache_type::iterator;
template<class Actor>
unique_mailbox_element_pointer next_message(Actor* self) {
......
......@@ -50,9 +50,9 @@ class priority_policy {
void push_to_cache(unique_mailbox_element_pointer ptr);
typedef std::vector<unique_mailbox_element_pointer> cache_type;
using cache_type = std::vector<unique_mailbox_element_pointer>;
typedef cache_type::iterator cache_iterator;
using cache_iterator = cache_type::iterator;
cache_iterator cache_begin();
......
......@@ -42,7 +42,7 @@ class scheduling_policy {
public:
/**
* @brief This typedef can be set freely by any implementation and is
* @brief This type can be set freely by any implementation and is
* used by callers to pass the result of @p init_timeout back to
* @p fetch_messages.
*/
......
......@@ -32,9 +32,23 @@
namespace cppa {
typedef variant<int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t,
uint64_t, float, double, long double, std::string,
std::u16string, std::u32string, atom_value> primitive_variant;
using primitive_variant = variant<
int8_t,
int16_t,
int32_t,
int64_t,
uint8_t,
uint16_t,
uint32_t,
uint64_t,
float,
double,
long double,
std::string,
std::u16string,
std::u32string,
atom_value
>;
} // namespace cppa
......
......@@ -35,7 +35,7 @@ class actor_widget_mixin : public Base {
public:
typedef typename actor_companion::message_pointer message_pointer;
using message_pointer = typename actor_companion::message_pointer;
struct event_type : public QEvent {
......
......@@ -27,8 +27,8 @@ template<typename... Is>
struct replies_to {
template<typename... Os>
struct with {
typedef detail::type_list<Is...> input_types;
typedef detail::type_list<Os...> output_types;
using input_types = detail::type_list<Is...>;
using output_types = detail::type_list<Os...>;
};
};
......
......@@ -192,7 +192,7 @@ class response_handle<Self, detail::type_list<Ts...>,
public:
typedef detail::type_list<Ts...> result_types;
using result_types = detail::type_list<Ts...>;
response_handle() = delete;
......@@ -202,14 +202,17 @@ class response_handle<Self, detail::type_list<Ts...>,
template<typename F>
void await(F fun) {
typedef typename detail::tl_map<
typename detail::get_callable_trait<F>::arg_types,
detail::rm_const_and_ref>::type arg_types;
using arg_types = typename detail::tl_map<
typename detail::get_callable_trait<F>::arg_types,
detail::rm_const_and_ref
>::type;
static constexpr size_t fun_args = detail::tl_size<arg_types>::value;
static_assert(fun_args <= detail::tl_size<result_types>::value,
"functor takes too much arguments");
typedef typename detail::tl_right<result_types, fun_args>::type
recv_types;
using recv_types = typename detail::tl_right<
result_types,
fun_args
>::type;
static_assert(std::is_same<arg_types, recv_types>::value,
"wrong functor signature");
behavior tmp = detail::fs2bhvr(m_self, fun);
......
......@@ -40,7 +40,7 @@ class sb_actor : public Base {
protected:
typedef sb_actor combined_type;
using combined_type = sb_actor;
public:
......
......@@ -82,9 +82,9 @@ class worker : public execution_unit {
worker& operator=(const worker&) = delete;
typedef resumable* job_ptr;
using job_ptr = resumable*;
typedef detail::producer_consumer_list<resumable> job_queue;
using job_queue = detail::producer_consumer_list<resumable>;
/**
* @brief Attempt to steal an element from the exposed job queue.
......
......@@ -33,11 +33,11 @@ namespace cppa {
template<class Base, class Subtype>
class single_timeout : public Base {
typedef Base super;
using super = Base;
public:
typedef single_timeout combined_type;
using combined_type = single_timeout;
template<typename... Ts>
single_timeout(Ts&&... args)
......
......@@ -88,7 +88,7 @@ struct spawn_fwd {
template<typename T, typename... Ts>
struct spawn_fwd<T(Ts...)> {
typedef T (*fun_pointer)(Ts...);
using fun_pointer = T (*)(Ts...);
static inline fun_pointer fwd(fun_pointer arg) { return arg; }
};
......@@ -114,9 +114,9 @@ intrusive_ptr<C> spawn_class(execution_unit* eu, BeforeLaunch before_launch_fun,
template<spawn_options Os, typename BeforeLaunch, typename F, typename... Ts>
actor spawn_functor(execution_unit* eu, BeforeLaunch cb, F fun, Ts&&... args) {
typedef typename detail::get_callable_trait<F>::type trait;
typedef typename trait::arg_types arg_types;
typedef typename detail::tl_head<arg_types>::type first_arg;
using trait = typename detail::get_callable_trait<F>::type;
using arg_types = typename trait::arg_types;
using first_arg = typename detail::tl_head<arg_types>::type;
using base_class = typename std::conditional<
std::is_pointer<first_arg>::value,
typename std::remove_pointer<first_arg>::type,
......@@ -199,22 +199,22 @@ namespace detail {
template<typename... Rs>
class functor_based_typed_actor : public typed_event_based_actor<Rs...> {
typedef typed_event_based_actor<Rs...> super;
using super = typed_event_based_actor<Rs...>;
public:
typedef typed_event_based_actor<Rs...>* pointer;
typedef typename super::behavior_type behavior_type;
using pointer = typed_event_based_actor<Rs...>*;
using behavior_type = typename super::behavior_type;
typedef std::function<behavior_type()> no_arg_fun;
typedef std::function<behavior_type(pointer)> one_arg_fun1;
typedef std::function<void(pointer)> one_arg_fun2;
using no_arg_fun = std::function<behavior_type()>;
using one_arg_fun1 = std::function<behavior_type(pointer)>;
using one_arg_fun2 = std::function<void(pointer)>;
template<typename F, typename... Ts>
functor_based_typed_actor(F fun, Ts&&... args) {
typedef typename detail::get_callable_trait<F>::type trait;
typedef typename trait::arg_types arg_types;
typedef typename trait::result_type result_type;
using trait = typename detail::get_callable_trait<F>::type;
using arg_types = typename trait::arg_types;
using result_type = typename trait::result_type;
constexpr bool returns_behavior =
std::is_same<result_type, behavior_type>::value;
constexpr bool uses_first_arg = std::is_same<
......@@ -276,13 +276,13 @@ struct infer_typed_actor_base;
template<typename... Rs, class FirstArg>
struct infer_typed_actor_base<typed_behavior<Rs...>, FirstArg> {
typedef functor_based_typed_actor<Rs...> type;
using type = functor_based_typed_actor<Rs...>;
};
template<typename... Rs>
struct infer_typed_actor_base<void, typed_event_based_actor<Rs...>*> {
typedef functor_based_typed_actor<Rs...> type;
using type = functor_based_typed_actor<Rs...>;
};
......@@ -308,10 +308,12 @@ typename detail::infer_typed_actor_handle<
typename detail::tl_head<
typename detail::get_callable_trait<F>::arg_types>::type>::type
spawn_typed_functor(execution_unit* eu, BeforeLaunch bl, F fun, Ts&&... args) {
typedef typename detail::infer_typed_actor_base<
typename detail::get_callable_trait<F>::result_type,
typename detail::tl_head<typename detail::get_callable_trait<
F>::arg_types>::type>::type impl;
using impl = typename detail::infer_typed_actor_base<
typename detail::get_callable_trait<F>::result_type,
typename detail::tl_head<
typename detail::get_callable_trait<F>::arg_types
>::type
>::type;
return spawn_class<impl, Os>(eu, bl, fun, std::forward<Ts>(args)...);
}
......
......@@ -81,14 +81,14 @@ struct infer_typed_actor_handle;
// infer actor type from result type if possible
template<typename... Rs, class FirstArg>
struct infer_typed_actor_handle<typed_behavior<Rs...>, FirstArg> {
typedef typed_actor<Rs...> type;
using type = typed_actor<Rs...>;
};
// infer actor type from first argument if result type is void
template<typename... Rs>
struct infer_typed_actor_handle<void, typed_event_based_actor<Rs...>*> {
typedef typed_actor<Rs...> type;
using type = typed_actor<Rs...>;
};
......@@ -97,7 +97,7 @@ struct actor_handle_from_signature_list;
template<typename... Rs>
struct actor_handle_from_signature_list<detail::type_list<Rs...>> {
typedef typed_actor<Rs...> type;
using type = typed_actor<Rs...>;
};
......
......@@ -93,7 +93,7 @@ typename std::enable_if<
bool
>::type
safe_equal(const T& lhs, const U& rhs) {
typedef decltype(lhs - rhs) res_type;
using res_type = decltype(lhs - rhs);
return std::fabs(lhs - rhs) <= std::numeric_limits<res_type>::epsilon();
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment