Commit 54f080df authored by neverlord's avatar neverlord

merged master into unstable

parents 0b5d229b 4c39c810
......@@ -48,7 +48,7 @@ struct testee : fsm_actor<testee>
{
actor_ptr parent;
behavior init_state;
testee(actor_ptr const& pptr) : parent(pptr)
testee(const actor_ptr& pptr) : parent(pptr)
{
init_state =
(
......
......@@ -55,7 +55,7 @@ constexpr uint64_t s_task_n = uint64_t(86028157)*329545133;
constexpr uint64_t s_factor1 = 86028157;
constexpr uint64_t s_factor2 = 329545133;
void check_factors(factors const& vec)
void check_factors(const factors& vec)
{
assert(vec.size() == 2);
assert(vec[0] == s_factor1);
......@@ -69,7 +69,7 @@ struct fsm_worker : fsm_actor<fsm_worker>
{
actor_ptr mc;
behavior init_state;
fsm_worker(actor_ptr const& msgcollector) : mc(msgcollector)
fsm_worker(const actor_ptr& msgcollector) : mc(msgcollector)
{
init_state =
(
......@@ -89,7 +89,7 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link>
{
actor_ptr next;
behavior init_state;
fsm_chain_link(actor_ptr const& n) : next(n)
fsm_chain_link(const actor_ptr& n) : next(n)
{
init_state =
(
......@@ -165,7 +165,7 @@ struct fsm_supervisor : fsm_actor<fsm_supervisor>
{
if (--left == 0) become_void();
},
on<atom("result"), factors>() >> [=](factors const& vec)
on<atom("result"), factors>() >> [=](const factors& vec)
{
check_factors(vec);
if (--left == 0) become_void();
......@@ -259,7 +259,7 @@ void supervisor(int num_msgs)
{
--num_msgs;
},
on<atom("result"), factors>() >> [&](factors const& vec)
on<atom("result"), factors>() >> [&](const factors& vec)
{
--num_msgs;
check_factors(vec);
......
......@@ -26,7 +26,7 @@ struct testee : Actor
uint32_t m_first_result;
std::vector<ActorRef> m_children;
void spread_handler(spread const& arg, const Address)
void spread_handler(const spread& arg, const Address)
{
if (arg.value == 0)
{
......@@ -44,7 +44,7 @@ struct testee : Actor
}
}
void result_handler(result const& arg, const Address)
void result_handler(const result& arg, const Address)
{
if (!m_first_result_received)
{
......@@ -60,7 +60,7 @@ struct testee : Actor
typedef struct { Address arg0; } Parameters;
testee(Parameters const& p) : m_parent(p.arg0), m_first_result_received(false)
testee(const Parameters& p) : m_parent(p.arg0), m_first_result_received(false)
{
RegisterHandler(this, &testee::spread_handler);
RegisterHandler(this, &testee::result_handler);
......
......@@ -23,7 +23,7 @@ struct receiver : Actor
int64_t m_num;
void handler(int64_t const&, const Address from)
void handler(const int64_t&, const Address from)
{
if (++m_num == t_max)
Send(t_max, from);
......
......@@ -32,11 +32,11 @@ struct worker_done { };
struct worker : Actor
{
void handle_calc(calc_msg const& msg, Address from)
void handle_calc(const calc_msg& msg, Address from)
{
factorize(msg.value);
}
void handle_master_done(master_done const&, Address from)
void handle_master_done(const master_done&, Address from)
{
Send(worker_done(), from);
}
......@@ -51,12 +51,12 @@ struct worker : Actor
struct chain_link : Actor
{
Address next;
void handle_token(token_msg const& msg, Address)
void handle_token(const token_msg& msg, Address)
{
Send(msg, next);
}
typedef struct { Address next; } Parameters;
chain_link(Parameters const& p) : next(p.next)
chain_link(const Parameters& p) : next(p.next)
{
RegisterHandler(this, &chain_link::handle_token);
}
......@@ -84,7 +84,7 @@ struct master : Actor
}
Send(token_msg{initial_token_value}, next);
}
void handle_init(init_msg const& msg, Address)
void handle_init(const init_msg& msg, Address)
{
w = GetFramework().CreateActor<worker>();
iteration = 0;
......@@ -93,7 +93,7 @@ struct master : Actor
max_iterations = msg.iterations;
new_ring();
}
void handle_token(token_msg const& msg, Address)
void handle_token(const token_msg& msg, Address)
{
if (msg.value == 0)
{
......@@ -111,13 +111,13 @@ struct master : Actor
Send(token_msg{msg.value - 1}, next);
}
}
void handle_worker_done(worker_done const&, Address)
void handle_worker_done(const worker_done&, Address)
{
Send(master_done(), mc);
w = ActorRef::Null();
}
typedef struct { Address mc; } Parameters;
master(Parameters const& p) : mc(p.mc), iteration(0)
master(const Parameters& p) : mc(p.mc), iteration(0)
{
RegisterHandler(this, &master::handle_init);
RegisterHandler(this, &master::handle_token);
......
......@@ -95,7 +95,7 @@ class abstract_actor : public Base
}
}
void detach(attachable::token const& what) // override
void detach(const attachable::token& what) // override
{
attachable_ptr uptr;
// lifetime scope of guard
......
......@@ -96,7 +96,7 @@ class actor : public channel
/**
* @brief Detaches the first attached object that matches @p what.
*/
virtual void detach(attachable::token const& what) = 0;
virtual void detach(const attachable::token& what) = 0;
template<typename T>
bool attach(std::unique_ptr<T>&& ptr,
......@@ -118,7 +118,7 @@ class actor : public channel
* @note Groups are leaved automatically if the Actor finishes
* execution.
*/
void leave(group_ptr const& what);
void leave(const group_ptr& what);
/**
* @brief Links this actor to @p other.
......@@ -175,7 +175,7 @@ class actor : public channel
* @brief Gets the {@link process_information} of the parent process.
* @returns The {@link process_information} of the parent process.
*/
inline process_information const& parent_process() const;
inline const process_information& parent_process() const;
/**
* @brief Gets the {@link process_information} pointer
......@@ -202,10 +202,10 @@ class actor : public channel
protected:
actor(process_information_ptr const& parent = process_information::get());
actor(const process_information_ptr& parent = process_information::get());
actor(std::uint32_t aid,
process_information_ptr const& parent = process_information::get());
const process_information_ptr& parent = process_information::get());
private:
......@@ -224,7 +224,7 @@ typedef intrusive_ptr<actor> actor_ptr;
* inline and template member function implementations *
******************************************************************************/
inline process_information const& actor::parent_process() const
inline const process_information& actor::parent_process() const
{
return *m_parent_process;
}
......@@ -271,7 +271,7 @@ class functor_attachable : public attachable
m_functor(reason);
}
bool matches(attachable::token const&)
bool matches(const attachable::token&)
{
return false;
}
......
......@@ -52,7 +52,7 @@ class actor_proxy : public abstract_actor<actor>
public:
actor_proxy(std::uint32_t mid, process_information_ptr const& parent);
actor_proxy(std::uint32_t mid, const process_information_ptr& parent);
void enqueue(actor* sender, any_tuple msg);
......@@ -74,7 +74,7 @@ class actor_proxy : public abstract_actor<actor>
public:
void forward_message(process_information_ptr const&, actor*, any_tuple&&);
void forward_message(const process_information_ptr&, actor*, any_tuple&&);
};
......
......@@ -98,7 +98,7 @@ namespace cppa {
* instance (mapped to @p plain_type); otherwise @c false
* is returned and @p uniform_type was deleted.
*/
bool announce(std::type_info const& tinfo, uniform_type_info* utype);
bool announce(const std::type_info& tinfo, uniform_type_info* utype);
// deals with member pointer
/**
......@@ -110,7 +110,7 @@ bool announce(std::type_info const& tinfo, uniform_type_info* utype);
*/
template<class C, class Parent, typename... Args>
std::pair<C Parent::*, util::abstract_uniform_type_info<C>*>
compound_member(C Parent::*c_ptr, Args const&... args)
compound_member(C Parent::*c_ptr, const Args&... args)
{
return { c_ptr, new detail::default_uniform_type_info_impl<C>(args...) };
}
......@@ -118,7 +118,7 @@ compound_member(C Parent::*c_ptr, Args const&... args)
// deals with getter returning a mutable reference
template<class C, class Parent, typename... Args>
std::pair<C& (Parent::*)(), util::abstract_uniform_type_info<C>*>
compound_member(C& (Parent::*c_ptr)(), Args const&... args)
compound_member(C& (Parent::*c_ptr)(), const Args&... args)
{
return { c_ptr, new detail::default_uniform_type_info_impl<C>(args...) };
}
......@@ -129,7 +129,7 @@ template<class Parent, typename GRes,
std::pair<std::pair<GRes (Parent::*)() const, SRes (Parent::*)(SArg)>,
util::abstract_uniform_type_info<typename util::rm_ref<GRes>::type>*>
compound_member(const std::pair<GRes (Parent::*)() const, SRes (Parent::*)(SArg)>& gspair,
Args const&... args)
const Args&... args)
{
return { gspair, new detail::default_uniform_type_info_impl<typename util::rm_ref<GRes>::type>(args...) };
}
......@@ -142,7 +142,7 @@ compound_member(const std::pair<GRes (Parent::*)() const, SRes (Parent::*)(SArg)
* otherwise @c false.
*/
template<typename T, typename... Args>
inline bool announce(Args const&... args)
inline bool announce(const Args&... args)
{
return announce(typeid(T),
new detail::default_uniform_type_info_impl<T>(args...));
......
......@@ -67,7 +67,7 @@ class any_tuple
* @brief Creates a tuple from @p t.
*/
template<typename... Args>
any_tuple(cow_tuple<Args...> const& t) : m_vals(t.vals()) { }
any_tuple(const cow_tuple<Args...>& t) : m_vals(t.vals()) { }
/**
* @brief Creates a tuple and moves the content from @p t.
......@@ -85,7 +85,7 @@ class any_tuple
/**
* @brief Copy constructor.
*/
any_tuple(any_tuple const&) = default;
any_tuple(const any_tuple&) = default;
/**
* @brief Move assignment.
......@@ -95,7 +95,7 @@ class any_tuple
/**
* @brief Copy assignment.
*/
any_tuple& operator=(any_tuple const&) = default;
any_tuple& operator=(const any_tuple&) = default;
/**
* @brief Gets the size of this tuple.
......@@ -121,7 +121,7 @@ class any_tuple
/**
* @brief Returns @c true if <tt>*this == other</tt>, otherwise false.
*/
bool equals(any_tuple const& other) const;
bool equals(const any_tuple& other) const;
/**
* @brief Returns true if <tt>size() == 0</tt>, otherwise false.
......@@ -129,7 +129,7 @@ class any_tuple
inline bool empty() const { return size() == 0; }
template<typename T>
inline T const& get_as(size_t p) const
inline const T& get_as(size_t p) const
{
CPPA_REQUIRE(*(type_at(p)) == typeid(T));
return *reinterpret_cast<T const*>(at(p));
......@@ -147,8 +147,8 @@ class any_tuple
inline const_iterator end() const { return m_vals->end(); }
inline cow_ptr<detail::abstract_tuple>& vals() { return m_vals; }
inline cow_ptr<detail::abstract_tuple> const& vals() const { return m_vals; }
inline cow_ptr<detail::abstract_tuple> const& cvals() const { return m_vals; }
inline const cow_ptr<detail::abstract_tuple>& vals() const { return m_vals; }
inline const cow_ptr<detail::abstract_tuple>& cvals() const { return m_vals; }
inline std::type_info const* type_token() const
{
......@@ -205,7 +205,7 @@ class any_tuple
cow_ptr<detail::abstract_tuple> m_vals;
explicit any_tuple(cow_ptr<detail::abstract_tuple> const& vals);
explicit any_tuple(const cow_ptr<detail::abstract_tuple>& vals);
typedef detail::abstract_tuple* tup_ptr;
......@@ -260,7 +260,7 @@ class any_tuple
/**
* @relates any_tuple
*/
inline bool operator==(any_tuple const& lhs, any_tuple const& rhs)
inline bool operator==(const any_tuple& lhs, const any_tuple& rhs)
{
return lhs.equals(rhs);
}
......@@ -268,7 +268,7 @@ inline bool operator==(any_tuple const& lhs, any_tuple const& rhs)
/**
* @relates any_tuple
*/
inline bool operator!=(any_tuple const& lhs, any_tuple const& rhs)
inline bool operator!=(const any_tuple& lhs, const any_tuple& rhs)
{
return !(lhs == rhs);
}
......
......@@ -40,12 +40,12 @@ namespace cppa {
*/
struct anything { };
inline bool operator==(anything const&, anything const&)
inline bool operator==(const anything&, const anything&)
{
return true;
}
inline bool operator!=(anything const&, anything const&)
inline bool operator!=(const anything&, const anything&)
{
return false;
}
......
......@@ -39,7 +39,7 @@ namespace cppa {
enum class atom_value : std::uint64_t { dirty_little_hack = 37337 };
std::string to_string(atom_value const& a);
std::string to_string(const atom_value& a);
/**
* @brief Creates an atom from given string literal.
......
......@@ -42,8 +42,8 @@ namespace cppa {
class attachable
{
attachable(attachable const&) = delete;
attachable& operator=(attachable const&) = delete;
attachable(const attachable&) = delete;
attachable& operator=(const attachable&) = delete;
protected:
......@@ -59,12 +59,12 @@ class attachable
/**
* @brief Denotes the type of @c ptr.
*/
std::type_info const& subtype;
const std::type_info& subtype;
/**
* @brief Any value, used to identify @c attachable instances.
*/
void const* ptr;
inline token(std::type_info const& msubtype, void const* mptr)
inline token(const std::type_info& msubtype, void const* mptr)
: subtype(msubtype), ptr(mptr)
{
}
......@@ -85,7 +85,7 @@ class attachable
* @param what A value that selects zero or more @c attachable instances.
* @returns @c true if @p what selects this instance; otherwise @c false.
*/
virtual bool matches(token const& what) = 0;
virtual bool matches(const token& what) = 0;
};
......
......@@ -54,8 +54,8 @@ class behavior
friend behavior operator,(partial_function&& lhs, behavior&& rhs);
behavior(behavior const&) = delete;
behavior& operator=(behavior const&) = delete;
behavior(const behavior&) = delete;
behavior& operator=(const behavior&) = delete;
public:
......@@ -67,7 +67,7 @@ class behavior
}
template<typename... Cases>
behavior(match_expr<Cases...> const& me) : m_fun(me) { }
behavior(const match_expr<Cases...>& me) : m_fun(me) { }
inline behavior(util::duration tout, std::function<void()>&& handler)
: m_timeout(tout), m_timeout_handler(std::move(handler))
......@@ -87,7 +87,7 @@ class behavior
m_timeout_handler();
}
inline util::duration const& timeout() const
inline const util::duration& timeout() const
{
return m_timeout;
}
......@@ -124,7 +124,7 @@ class behavior
};
template<typename... Lhs>
behavior operator,(match_expr<Lhs...> const& lhs,
behavior operator,(const match_expr<Lhs...>& lhs,
behavior&& rhs)
{
rhs.get_partial_function() = lhs;
......
......@@ -54,7 +54,7 @@ class binary_deserializer : public deserializer
std::string seek_object();
std::string peek_object();
void begin_object(std::string const& type_name);
void begin_object(const std::string& type_name);
void end_object();
size_t begin_sequence();
void end_sequence();
......
......@@ -60,7 +60,7 @@ class binary_serializer : public serializer
~binary_serializer();
void begin_object(std::string const& tname);
void begin_object(const std::string& tname);
void end_object();
......@@ -68,7 +68,7 @@ class binary_serializer : public serializer
void end_sequence();
void write_value(primitive_variant const& value);
void write_value(const primitive_variant& value);
void write_tuple(size_t size, primitive_variant const* values);
......
......@@ -58,10 +58,10 @@ class cow_ptr
cow_ptr(cow_ptr&& other) : m_ptr(std::move(other.m_ptr)) { }
cow_ptr(cow_ptr const& other) : m_ptr(other.m_ptr) { }
cow_ptr(const cow_ptr& other) : m_ptr(other.m_ptr) { }
template<typename Y>
cow_ptr(cow_ptr<Y> const& other) : m_ptr(const_cast<Y*>(other.get())) { }
cow_ptr(const cow_ptr<Y>& other) : m_ptr(const_cast<Y*>(other.get())) { }
inline void swap(cow_ptr& other)
{
......@@ -74,7 +74,7 @@ class cow_ptr
return *this;
}
cow_ptr& operator=(cow_ptr const& other)
cow_ptr& operator=(const cow_ptr& other)
{
cow_ptr tmp{other};
swap(tmp);
......@@ -82,7 +82,7 @@ class cow_ptr
}
template<typename Y>
cow_ptr& operator=(cow_ptr<Y> const& other)
cow_ptr& operator=(const cow_ptr<Y>& other)
{
cow_ptr tmp{other};
swap(tmp);
......@@ -104,7 +104,7 @@ class cow_ptr
inline T const* get() const { return ptr(); }
inline T const& operator*() const { return *ptr(); }
inline const T& operator*() const { return *ptr(); }
inline T const* operator->() const { return ptr(); }
......
......@@ -102,7 +102,7 @@ class cow_tuple
* @brief Initializes the cow_tuple with @p args.
* @param args Initialization values.
*/
cow_tuple(ElementTypes const&... args) : m_vals(new data_type(args...))
cow_tuple(const ElementTypes&... args) : m_vals(new data_type(args...))
{
}
......@@ -115,9 +115,9 @@ class cow_tuple
}
cow_tuple(cow_tuple&&) = default;
cow_tuple(cow_tuple const&) = default;
cow_tuple(const cow_tuple&) = default;
cow_tuple& operator=(cow_tuple&&) = default;
cow_tuple& operator=(cow_tuple const&) = default;
cow_tuple& operator=(const cow_tuple&) = default;
inline static cow_tuple from(cow_ptr_type ptr)
{
......@@ -125,7 +125,7 @@ class cow_tuple
}
inline static cow_tuple from(cow_ptr_type ptr,
util::fixed_vector<size_t, num_elements> const& mv)
const util::fixed_vector<size_t, num_elements>& mv)
{
return {priv_ctor{}, decorated_type::create(std::move(ptr), mv)};
}
......@@ -169,7 +169,7 @@ class cow_tuple
return m_vals->type_at(p);
}
inline cow_ptr<detail::abstract_tuple> const& vals() const
inline const cow_ptr<detail::abstract_tuple>& vals() const
{
return m_vals;
}
......@@ -196,7 +196,7 @@ struct cow_tuple_from_type_list< util::type_list<Types...> >
* @relates cow_tuple
*/
template<size_t N, typename T>
T const& get(cow_tuple<...> const& tup);
const T& get(const cow_tuple<...>& tup);
/**
* @ingroup CopyOnWrite
......@@ -223,7 +223,7 @@ cow_tuple<Args...> make_cow_tuple(Args&&... args);
#else
template<size_t N, typename... Types>
const typename util::at<N, Types...>::type& get(cow_tuple<Types...> const& tup)
const typename util::at<N, Types...>::type& get(const cow_tuple<Types...>& tup)
{
typedef typename util::at<N, Types...>::type result_type;
return *reinterpret_cast<result_type const*>(tup.at(N));
......@@ -253,8 +253,8 @@ make_cow_tuple(Args&&... args)
* @relates cow_tuple
*/
template<typename... LhsTypes, typename... RhsTypes>
inline bool operator==(cow_tuple<LhsTypes...> const& lhs,
cow_tuple<RhsTypes...> const& rhs)
inline bool operator==(const cow_tuple<LhsTypes...>& lhs,
const cow_tuple<RhsTypes...>& rhs)
{
return util::compare_tuples(lhs, rhs);
}
......@@ -267,8 +267,8 @@ inline bool operator==(cow_tuple<LhsTypes...> const& lhs,
* @relates cow_tuple
*/
template<typename... LhsTypes, typename... RhsTypes>
inline bool operator!=(cow_tuple<LhsTypes...> const& lhs,
cow_tuple<RhsTypes...> const& rhs)
inline bool operator!=(const cow_tuple<LhsTypes...>& lhs,
const cow_tuple<RhsTypes...>& rhs)
{
return !(lhs == rhs);
}
......
......@@ -217,7 +217,7 @@
* @code
* receive
* (
* on<atom("hello"), std::string>() >> [](std::string const& msg)
* on<atom("hello"), std::string>() >> [](const std::string& msg)
* {
* cout << "received hello message: " << msg << endl;
* },
......@@ -242,7 +242,7 @@
* @code
* receive
* (
* on(atom("hello"), val<std::string>()) >> [](std::string const& msg)
* on(atom("hello"), val<std::string>()) >> [](const std::string& msg)
* {
* cout << "received hello message: " << msg << endl;
* },
......@@ -541,7 +541,7 @@ inline actor_ptr spawn(F&& what, Arg0&& arg0, Args&&... args)
* /
template<scheduling_hint Hint, typename F, typename... Args>
auto //actor_ptr
spawn(F&& what, Args const&... args)
spawn(F&& what, const Args&... args)
-> typename std::enable_if<
!std::is_convertible<typename util::rm_ref<F>::type, scheduled_actor*>::value
&& !std::is_convertible<typename util::rm_ref<F>::type, event_based_actor*>::value,
......@@ -560,7 +560,7 @@ spawn(F&& what, Args const&... args)
* /
template<typename F, typename... Args>
auto // actor_ptr
spawn(F&& what, Args const&... args)
spawn(F&& what, const Args&... args)
-> typename std::enable_if<
!std::is_convertible<typename util::rm_ref<F>::type, scheduled_actor*>::value
&& !std::is_convertible<typename util::rm_ref<F>::type, event_based_actor*>::value,
......@@ -578,7 +578,7 @@ spawn(F&& what, Args const&... args)
* @brief Sends <tt>{arg0, args...}</tt> as a message to @p whom.
*/
template<typename Arg0, typename... Args>
void send(channel_ptr& whom, Arg0 const& arg0, Args const&... args);
void send(channel_ptr& whom, const Arg0& arg0, const Args&... args);
/**
* @ingroup MessageHandling
......@@ -590,19 +590,19 @@ void send(channel_ptr& whom, Arg0 const& arg0, Args const&... args);
* @endcode
* @returns @p whom.
*/
channel_ptr& operator<<(channel_ptr& whom, any_tuple const& what);
channel_ptr& operator<<(channel_ptr& whom, const any_tuple& what);
#else
template<class C, typename Arg0, typename... Args>
void send(intrusive_ptr<C>& whom, Arg0 const& arg0, Args const&... args)
void send(intrusive_ptr<C>& whom, const Arg0& arg0, const Args&... args)
{
static_assert(std::is_base_of<channel, C>::value, "C is not a channel");
if (whom) self->send_message(whom.get(), make_cow_tuple(arg0, args...));
}
template<class C, typename Arg0, typename... Args>
void send(intrusive_ptr<C>&& whom, Arg0 const& arg0, Args const&... args)
void send(intrusive_ptr<C>&& whom, const Arg0& arg0, const Args&... args)
{
static_assert(std::is_base_of<channel, C>::value, "C is not a channel");
intrusive_ptr<C> tmp(std::move(whom));
......@@ -611,7 +611,7 @@ void send(intrusive_ptr<C>&& whom, Arg0 const& arg0, Args const&... args)
// matches "send(this, ...)" in event-based actors
template<typename Arg0, typename... Args>
inline void send(local_actor* whom, Arg0 const& arg0, Args const&... args)
inline void send(local_actor* whom, const Arg0& arg0, const Args&... args)
{
CPPA_REQUIRE(whom != nullptr);
whom->enqueue(whom, make_cow_tuple(arg0, args...));
......@@ -620,7 +620,7 @@ inline void send(local_actor* whom, Arg0 const& arg0, Args const&... args)
// matches send(self, ...);
template<typename Arg0, typename... Args>
inline void send(self_type const&, Arg0 const& arg0, Args const&... args)
inline void send(const self_type&, const Arg0& arg0, const Args&... args)
{
send(static_cast<local_actor*>(self), arg0, args...);
}
......@@ -630,7 +630,7 @@ typename std::enable_if<
std::is_base_of<channel, C>::value,
intrusive_ptr<C>&
>::type
operator<<(intrusive_ptr<C>& whom, any_tuple const& what)
operator<<(intrusive_ptr<C>& whom, const any_tuple& what)
{
if (whom) self->send_message(whom.get(), what);
return whom;
......@@ -641,7 +641,7 @@ typename std::enable_if<
std::is_base_of<channel, C>::value,
intrusive_ptr<C>
>::type
operator<<(intrusive_ptr<C>&& whom, any_tuple const& what)
operator<<(intrusive_ptr<C>&& whom, const any_tuple& what)
{
intrusive_ptr<C> tmp(std::move(whom));
tmp << what;
......@@ -671,9 +671,9 @@ operator<<(intrusive_ptr<C>&& whom, any_tuple&& what)
return std::move(tmp);
}
self_type const& operator<<(self_type const& s, any_tuple const& what);
const self_type& operator<<(const self_type& s, const any_tuple& what);
self_type const& operator<<(self_type const& s, any_tuple&& what);
const self_type& operator<<(const self_type& s, any_tuple&& what);
#endif // CPPA_DOCUMENTATION
......@@ -682,7 +682,7 @@ self_type const& operator<<(self_type const& s, any_tuple&& what);
* @brief Sends a message to the sender of the last received message.
*/
template<typename Arg0, typename... Args>
void reply(Arg0 const& arg0, Args const&... args)
void reply(const Arg0& arg0, const Args&... args)
{
send(self->last_sender(), arg0, args...);
}
......@@ -695,7 +695,7 @@ void reply(Arg0 const& arg0, Args const&... args)
* @param data Any number of values for the message content.
*/
template<typename Duration, typename... Data>
void future_send(actor_ptr whom, Duration const& rel_time, Data const&... data)
void future_send(actor_ptr whom, const Duration& rel_time, const Data&... data)
{
get_scheduler()->future_send(whom, rel_time, data...);
}
......@@ -706,7 +706,7 @@ void future_send(actor_ptr whom, Duration const& rel_time, Data const&... data)
* @see future_send()
*/
template<typename Duration, typename... Data>
void delayed_reply(Duration const& rel_time, Data const... data)
void delayed_reply(const Duration& rel_time, Data const... data)
{
future_send(self->last_sender(), rel_time, data...);
}
......
......@@ -48,8 +48,8 @@ class object;
class deserializer
{
deserializer(deserializer const&) = delete;
deserializer& operator=(deserializer const&) = delete;
deserializer(const deserializer&) = delete;
deserializer& operator=(const deserializer&) = delete;
public:
......@@ -73,7 +73,7 @@ class deserializer
* @brief Begins deserialization of an object of type @p type_name.
* @param type_name The platform-independent @p libcppa type name.
*/
virtual void begin_object(std::string const& type_name) = 0;
virtual void begin_object(const std::string& type_name) = 0;
/**
* @brief Ends deserialization of an object.
......
......@@ -93,7 +93,7 @@ class abstract_scheduled_actor : public abstract_actor<scheduled_actor>
return m_has_pending_timeout_request;
}
void request_timeout(util::duration const& d)
void request_timeout(const util::duration& d)
{
if (d.valid())
{
......
......@@ -58,7 +58,7 @@ class abstract_tuple : public ref_counted
public:
inline abstract_tuple(tuple_impl_info tii) : m_impl_type(tii) { }
abstract_tuple(abstract_tuple const& other);
abstract_tuple(const abstract_tuple& other);
// mutators
virtual void* mutable_at(size_t pos) = 0;
......@@ -85,7 +85,7 @@ class abstract_tuple : public ref_counted
// (default returns &typeid(void))
virtual std::type_info const* type_token() const;
bool equals(abstract_tuple const& other) const;
bool equals(const abstract_tuple& other) const;
typedef tuple_iterator<abstract_tuple> const_iterator;
......@@ -101,8 +101,8 @@ struct full_eq_type
{
constexpr full_eq_type() { }
template<class Tuple>
inline bool operator()(tuple_iterator<Tuple> const& lhs,
tuple_iterator<Tuple> const& rhs) const
inline bool operator()(const tuple_iterator<Tuple>& lhs,
const tuple_iterator<Tuple>& rhs) const
{
return lhs.type() == rhs.type()
&& lhs.type()->equals(lhs.value(), rhs.value());
......@@ -113,14 +113,14 @@ struct types_only_eq_type
{
constexpr types_only_eq_type() { }
template<class Tuple>
inline bool operator()(tuple_iterator<Tuple> const& lhs,
inline bool operator()(const tuple_iterator<Tuple>& lhs,
uniform_type_info const* rhs ) const
{
return lhs.type() == rhs;
}
template<class Tuple>
inline bool operator()(uniform_type_info const* lhs,
tuple_iterator<Tuple> const& rhs) const
const tuple_iterator<Tuple>& rhs) const
{
return lhs == rhs.type();
}
......
......@@ -54,7 +54,7 @@ class actor_proxy_cache
process_information::node_id_type const& node_id);
// @returns true if pptr was successfully removed, false otherwise
bool erase(actor_proxy_ptr const& pptr);
bool erase(const actor_proxy_ptr& pptr);
template<typename Fun>
void erase_all(process_information::node_id_type const& nid,
......@@ -94,7 +94,7 @@ class actor_proxy_cache
util::shared_spinlock m_lock;
std::map<key_tuple, actor_proxy_ptr, key_tuple_less> m_entries;
actor_proxy_ptr get_impl(key_tuple const& key);
actor_proxy_ptr get_impl(const key_tuple& key);
};
......
......@@ -52,7 +52,7 @@ class actor_registry
// return nullptr if the actor wasn't put *or* finished execution
actor_ptr get(actor_id key) const;
void put(actor_id key, actor_ptr const& value);
void put(actor_id key, const actor_ptr& value);
void erase(actor_id key);
......
......@@ -49,16 +49,16 @@ class addressed_message
addressed_message() = default;
addressed_message(addressed_message&&) = default;
addressed_message(addressed_message const&) = default;
addressed_message(const addressed_message&) = default;
addressed_message& operator=(addressed_message&&) = default;
addressed_message& operator=(addressed_message const&) = default;
addressed_message& operator=(const addressed_message&) = default;
inline actor_ptr& sender()
{
return m_sender;
}
inline actor_ptr const& sender() const
inline const actor_ptr& sender() const
{
return m_sender;
}
......@@ -68,7 +68,7 @@ class addressed_message
return m_receiver;
}
inline channel_ptr const& receiver() const
inline const channel_ptr& receiver() const
{
return m_receiver;
}
......@@ -78,7 +78,7 @@ class addressed_message
return m_content;
}
inline any_tuple const& content() const
inline const any_tuple& content() const
{
return m_content;
}
......@@ -96,9 +96,9 @@ class addressed_message
};
bool operator==(addressed_message const& lhs, addressed_message const& rhs);
bool operator==(const addressed_message& lhs, const addressed_message& rhs);
inline bool operator!=(addressed_message const& lhs, addressed_message const& rhs)
inline bool operator!=(const addressed_message& lhs, const addressed_message& rhs)
{
return !(lhs == rhs);
}
......
......@@ -40,7 +40,7 @@ namespace cppa { namespace detail {
// public part of the actor interface
struct channel : ref_counted
{
virtual void enqueue_msg(message const& msg) = 0;
virtual void enqueue_msg(const message& msg) = 0;
};
} } // namespace cppa::detail
......
......@@ -65,7 +65,7 @@ class decorated_tuple : public abstract_tuple
typedef cow_ptr<abstract_tuple> cow_pointer_type;
static inline cow_pointer_type create(cow_pointer_type d,
vector_type const& v)
const vector_type& v)
{
return cow_pointer_type{new decorated_tuple(std::move(d), v)};
}
......@@ -114,12 +114,12 @@ class decorated_tuple : public abstract_tuple
cow_pointer_type m_decorated;
vector_type m_mapping;
decorated_tuple(cow_pointer_type d, vector_type const& v)
decorated_tuple(cow_pointer_type d, const vector_type& v)
: super(tuple_impl_info::statically_typed)
, m_decorated(std::move(d)), m_mapping(v)
{
# ifdef CPPA_DEBUG
cow_pointer_type const& ptr = m_decorated; // prevent detaching
const cow_pointer_type& ptr = m_decorated; // prevent detaching
# endif
CPPA_REQUIRE(ptr->size() >= sizeof...(ElementTypes));
CPPA_REQUIRE(v.size() == sizeof...(ElementTypes));
......@@ -130,7 +130,7 @@ class decorated_tuple : public abstract_tuple
: super(tuple_impl_info::statically_typed), m_decorated(std::move(d))
{
# ifdef CPPA_DEBUG
cow_pointer_type const& ptr = m_decorated; // prevent detaching
const cow_pointer_type& ptr = m_decorated; // prevent detaching
# endif
CPPA_REQUIRE((ptr->size() - offset) >= sizeof...(ElementTypes));
CPPA_REQUIRE(offset > 0);
......@@ -139,9 +139,9 @@ class decorated_tuple : public abstract_tuple
std::generate(m_mapping.begin(), m_mapping.end(), [&]() {return i++;});
}
decorated_tuple(decorated_tuple const&) = default;
decorated_tuple(const decorated_tuple&) = default;
decorated_tuple& operator=(decorated_tuple const&) = delete;
decorated_tuple& operator=(const decorated_tuple&) = delete;
};
......
......@@ -127,8 +127,8 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
void*,
deserializer* )> m_deserialize;
member(member const&) = delete;
member& operator=(member const&) = delete;
member(const member&) = delete;
member& operator=(const member&) = delete;
void swap(member& other)
{
......
......@@ -45,7 +45,7 @@ struct empty_tuple : abstract_tuple
void* mutable_at(size_t);
abstract_tuple* copy() const;
void const* at(size_t) const;
bool equals(abstract_tuple const& other) const;
bool equals(const abstract_tuple& other) const;
uniform_type_info const* type_at(size_t) const;
std::type_info const* type_token() const;
......
......@@ -73,7 +73,7 @@ class ftor_behavior<true, true, F, Args...> : public scheduled_actor
public:
ftor_behavior(F ptr, Args const&... args) : m_fun(ptr), m_args(args...) { }
ftor_behavior(F ptr, const Args&... args) : m_fun(ptr), m_args(args...) { }
virtual void act() { util::apply_tuple(m_fun, m_args); }
......@@ -87,7 +87,7 @@ class ftor_behavior<false, false, F> : public scheduled_actor
public:
ftor_behavior(F const& arg) : m_fun(arg) { }
ftor_behavior(const F& arg) : m_fun(arg) { }
ftor_behavior(F&& arg) : m_fun(std::move(arg)) { }
......@@ -112,11 +112,11 @@ class ftor_behavior<false, true, F, Args...> : public scheduled_actor
public:
ftor_behavior(F const& f, Args const&... args) : m_fun(f), m_args(args...)
ftor_behavior(const F& f, const Args&... args) : m_fun(f), m_args(args...)
{
}
ftor_behavior(F&& f,Args const&... args) : m_fun(std::move(f))
ftor_behavior(F&& f,const Args&... args) : m_fun(std::move(f))
, m_args(args...)
{
}
......@@ -149,8 +149,8 @@ scheduled_actor* get_behavior(std::integral_constant<bool,false>, F&& ftor)
template<typename F, typename Arg0, typename... Args>
scheduled_actor* get_behavior(std::integral_constant<bool,true>,
F fptr,
Arg0 const& arg0,
Args const&... args)
const Arg0& arg0,
const Args&... args)
{
static_assert(std::is_convertible<decltype(fptr(arg0, args...)), scheduled_actor*>::value == false,
"Spawning a function returning an actor_behavior? "
......@@ -163,8 +163,8 @@ scheduled_actor* get_behavior(std::integral_constant<bool,true>,
template<typename F, typename Arg0, typename... Args>
scheduled_actor* get_behavior(std::integral_constant<bool,false>,
F ftor,
Arg0 const& arg0,
Args const&... args)
const Arg0& arg0,
const Args&... args)
{
static_assert(std::is_convertible<decltype(ftor(arg0, args...)), scheduled_actor*>::value == false,
"Spawning a functor returning an actor_behavior? "
......
......@@ -46,8 +46,8 @@ class group_manager
group_manager();
intrusive_ptr<group> get(std::string const& module_name,
std::string const& group_identifier);
intrusive_ptr<group> get(const std::string& module_name,
const std::string& group_identifier);
intrusive_ptr<group> anonymous();
......
......@@ -56,13 +56,13 @@ struct implicit_conversions
subtype1;
typedef typename util::replace_type<subtype1, std::u16string,
std::is_same<subtype1, char16_t const*>,
std::is_same<subtype1, const char16_t*>,
std::is_same<subtype1, char16_t*>,
util::is_array_of<subtype1, char16_t>>::type
subtype2;
typedef typename util::replace_type<subtype2, std::u32string,
std::is_same<subtype2, char32_t const*>,
std::is_same<subtype2, const char32_t*>,
std::is_same<subtype2, char32_t*>,
util::is_array_of<subtype2, char32_t>>::type
subtype3;
......
......@@ -51,8 +51,8 @@ namespace cppa { namespace detail {
class invokable
{
invokable(invokable const&) = delete;
invokable& operator=(invokable const&) = delete;
invokable(const invokable&) = delete;
invokable& operator=(const invokable&) = delete;
public:
......@@ -62,9 +62,9 @@ class invokable
virtual ~invokable();
// Checks whether the types of @p value match the pattern.
virtual bool types_match(any_tuple const& value) const;
virtual bool types_match(const any_tuple& value) const;
// Checks whether this invokable could be invoked with @p value.
virtual bool could_invoke(any_tuple const& value) const;
virtual bool could_invoke(const any_tuple& value) const;
// Type checking.
virtual bool invoke(any_tuple& value) const;
......@@ -86,22 +86,22 @@ struct pattern_policy
Pattern m_pattern;
template<typename... Args>
pattern_policy(Args&&... args) : m_pattern(std::forward<Args>(args)...) { }
bool types_match(any_tuple const& value) const
bool types_match(const any_tuple& value) const
{
return matches_types(value, m_pattern);
}
bool could_invoke(any_tuple const& value) const
bool could_invoke(const any_tuple& value) const
{
return matches(value, m_pattern);
}
template<typename Fun>
bool call(Fun const& fun, any_tuple& value) const
bool call(const Fun& fun, any_tuple& value) const
{
fun(value);
return true;
}
template<typename Fun>
bool call_unsafe(Fun const& fun, any_tuple& value) const
bool call_unsafe(const Fun& fun, any_tuple& value) const
{
fun(value);
return true;
......@@ -114,16 +114,16 @@ struct pattern_policy<map_to_option, Pattern>
Pattern m_pattern;
template<typename... Args>
pattern_policy(Args&&... args) : m_pattern(std::forward<Args>(args)...) { }
bool types_match(any_tuple const& value) const
bool types_match(const any_tuple& value) const
{
return matches_types(value, m_pattern);
}
bool could_invoke(any_tuple const& value) const
bool could_invoke(const any_tuple& value) const
{
return matches(value, m_pattern);
}
template<typename Fun>
bool call(Fun const& fun, any_tuple& value) const
bool call(const Fun& fun, any_tuple& value) const
{
auto result = moving_tuple_cast(value, m_pattern);
if (result)
......@@ -134,7 +134,7 @@ struct pattern_policy<map_to_option, Pattern>
return false;
}
template<typename Fun>
bool call_unsafe(Fun const& fun, any_tuple& value) const
bool call_unsafe(const Fun& fun, any_tuple& value) const
{
auto result = unsafe_tuple_cast(value, m_pattern);
if (result)
......@@ -152,16 +152,16 @@ struct pattern_policy<map_to_bool, Pattern>
Pattern m_pattern;
template<typename... Args>
pattern_policy(Args&&... args) : m_pattern(std::forward<Args>(args)...) { }
bool types_match(any_tuple const& value) const
bool types_match(const any_tuple& value) const
{
return matches_types(value, m_pattern);
}
bool could_invoke(any_tuple const& value) const
bool could_invoke(const any_tuple& value) const
{
return matches(value, m_pattern);
}
template<typename Fun>
bool call(Fun const& fun, any_tuple& value) const
bool call(const Fun& fun, any_tuple& value) const
{
if (could_invoke(value))
{
......@@ -171,7 +171,7 @@ struct pattern_policy<map_to_bool, Pattern>
return false;
}
template<typename Fun>
bool call_unsafe(Fun const& fun, any_tuple& value) const
bool call_unsafe(const Fun& fun, any_tuple& value) const
{
if (could_invoke(value))
{
......@@ -184,22 +184,22 @@ struct pattern_policy<map_to_bool, Pattern>
struct dummy_policy
{
inline bool types_match(any_tuple const&) const
inline bool types_match(const any_tuple&) const
{
return true;
}
inline bool could_invoke(any_tuple const&) const
inline bool could_invoke(const any_tuple&) const
{
return true;
}
template<typename Fun>
inline bool call(Fun const& fun, any_tuple&) const
inline bool call(const Fun& fun, any_tuple&) const
{
fun();
return true;
}
template<typename Fun>
inline bool call_unsafe(Fun const& fun, any_tuple&) const
inline bool call_unsafe(const Fun& fun, any_tuple&) const
{
fun();
return true;
......@@ -230,12 +230,12 @@ struct invokable_impl : public invokable
return m_policy.call_unsafe(m_fun, value);
}
bool types_match(any_tuple const& value) const
bool types_match(const any_tuple& value) const
{
return m_policy.types_match(value);
}
bool could_invoke(any_tuple const& value) const
bool could_invoke(const any_tuple& value) const
{
return m_policy.could_invoke(value);
}
......
......@@ -41,7 +41,7 @@ struct list_member_util
{
typedef typename List::value_type value_type;
static constexpr primitive_type vptype = type_to_ptype<value_type>::ptype;
void operator()(List const& list, serializer* s) const
void operator()(const List& list, serializer* s) const
{
s->begin_sequence(list.size());
for (auto i = list.begin(); i != list.end(); ++i)
......@@ -73,7 +73,7 @@ struct list_member_util<List, false>
{
}
void operator()(List const& list, serializer* s) const
void operator()(const List& list, serializer* s) const
{
s->begin_sequence(list.size());
for (auto i = list.begin(); i != list.end(); ++i)
......
......@@ -53,7 +53,7 @@ struct map_member_util<T, false, true>
{
primitive_member<T> impl;
void serialize_value(T const& what, serializer* s) const
void serialize_value(const T& what, serializer* s) const
{
impl.serialize(&what, s);
}
......@@ -77,7 +77,7 @@ struct map_member_util<T, false, false>
{
}
void serialize_value(T const& what, serializer* s) const
void serialize_value(const T& what, serializer* s) const
{
m_type->serialize(&what, s);
}
......@@ -103,7 +103,7 @@ struct map_member_util<T, true, false>
pair_member<first_type, second_type> impl;
void serialize_value(T const& what, serializer* s) const
void serialize_value(const T& what, serializer* s) const
{
// impl needs a pair without const modifier
std::pair<first_type, second_type> p(what.first, what.second);
......@@ -139,7 +139,7 @@ class map_member : public util::abstract_uniform_type_info<Map>
{
auto& mp = *reinterpret_cast<Map const*>(obj);
s->begin_sequence(mp.size());
for (auto const& val : mp)
for (const auto& val : mp)
{
m_helper.serialize_value(val, s);
}
......
This diff is collapsed.
......@@ -50,11 +50,11 @@ class object_array : public abstract_tuple
object_array();
object_array(object_array&&) = default;
object_array(object_array const&) = default;
object_array(const object_array&) = default;
void push_back(object&& what);
void push_back(object const& what);
void push_back(const object& what);
void* mutable_at(size_t pos);
......@@ -64,7 +64,7 @@ class object_array : public abstract_tuple
void const* at(size_t pos) const;
bool equals(cppa::detail::abstract_tuple const&) const;
bool equals(const cppa::detail::abstract_tuple&) const;
uniform_type_info const* type_at(size_t pos) const;
......
......@@ -36,7 +36,7 @@
namespace cppa {
template<typename T>
utype const& uniform_type_info();
const utype& uniform_type_info();
}
......@@ -47,9 +47,9 @@ struct obj_impl : object
{
T m_value;
obj_impl() : m_value() { }
obj_impl(T const& v) : m_value(v) { }
obj_impl(const T& v) : m_value(v) { }
virtual object* copy() const { return new obj_impl(m_value); }
virtual utype const& type() const { return uniform_type_info<T>(); }
virtual const utype& type() const { return uniform_type_info<T>(); }
virtual void* mutable_value() { return &m_value; }
virtual void const* value() const { return &m_value; }
virtual void serialize(serializer& s) const
......
......@@ -49,10 +49,10 @@ struct po_message
void post_office_loop(int input_fd);
void post_office_add_peer(native_socket_type peer_socket,
process_information_ptr const& peer_ptr);
const process_information_ptr& peer_ptr);
void post_office_publish(native_socket_type server_socket,
actor_ptr const& published_actor);
const actor_ptr& published_actor);
void post_office_unpublish(actor_id whom);
......
/******************************************************************************\
* ___ __ *
* /\_ \ __/\ \ *
* \//\ \ /\_\ \ \____ ___ _____ _____ __ *
* \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
* \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
* /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
* \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
* \ \_\ \ \_\ *
* \/_/ \/_/ *
* *
* Copyright (C) 2011, 2012 *
* Dominik Charousset <dominik.charousset@haw-hamburg.de> *
* *
* This file is part of libcppa. *
* libcppa is free software: you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License *
* or (at your option) any later version. *
* *
* libcppa is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with libcppa. If not, see <http://www.gnu.org/licenses/>. *
\******************************************************************************/
#ifndef POST_OFFICE_MSG_HPP
#define POST_OFFICE_MSG_HPP
#include "cppa/attachable.hpp"
#include "cppa/actor_proxy.hpp"
#include "cppa/intrusive_ptr.hpp"
#include "cppa/process_information.hpp"
#include "cppa/detail/native_socket.hpp"
#include "cppa/intrusive/single_reader_queue.hpp"
namespace cppa { namespace detail {
class post_office_msg
{
friend class intrusive::singly_linked_list<post_office_msg>;
friend class intrusive::single_reader_queue<post_office_msg>;
public:
enum msg_type
{
invalid_type,
add_peer_type,
add_server_socket_type,
proxy_exited_type
};
struct add_peer
{
native_socket_type sockfd;
process_information_ptr peer;
actor_proxy_ptr first_peer_actor;
std::unique_ptr<attachable> attachable_ptr;
add_peer(native_socket_type peer_socket,
const process_information_ptr& peer_ptr,
const actor_proxy_ptr& peer_actor_ptr,
std::unique_ptr<attachable>&& peer_observer);
};
struct add_server_socket
{
native_socket_type server_sockfd;
actor_ptr published_actor;
add_server_socket(native_socket_type ssockfd, const actor_ptr& whom);
};
struct proxy_exited
{
actor_proxy_ptr proxy_ptr;
inline proxy_exited(const actor_proxy_ptr& who) : proxy_ptr(who) { }
};
inline post_office_msg() : next(nullptr), m_type(invalid_type) { }
post_office_msg(native_socket_type arg0,
const process_information_ptr& arg1,
const actor_proxy_ptr& arg2,
std::unique_ptr<attachable>&& arg3);
post_office_msg(native_socket_type arg0, const actor_ptr& arg1);
post_office_msg(const actor_proxy_ptr& proxy_ptr);
inline bool is_add_peer_msg() const
{
return m_type == add_peer_type;
}
inline bool is_add_server_socket_msg() const
{
return m_type == add_server_socket_type;
}
inline bool is_proxy_exited_msg() const
{
return m_type == proxy_exited_type;
}
inline add_peer& as_add_peer_msg()
{
return m_add_peer_msg;
}
inline add_server_socket& as_add_server_socket_msg()
{
return m_add_server_socket;
}
inline proxy_exited& as_proxy_exited_msg()
{
return m_proxy_exited;
}
~post_office_msg();
private:
post_office_msg* next;
msg_type m_type;
union
{
add_peer m_add_peer_msg;
add_server_socket m_add_server_socket;
proxy_exited m_proxy_exited;
};
};
constexpr std::uint32_t rd_queue_event = 0x00;
constexpr std::uint32_t unpublish_actor_event = 0x01;
constexpr std::uint32_t close_socket_event = 0x02;
constexpr std::uint32_t shutdown_event = 0x03;
typedef std::uint32_t pipe_msg[2];
constexpr size_t pipe_msg_size = 2 * sizeof(std::uint32_t);
} } // namespace cppa::detail
#endif // POST_OFFICE_MSG_HPP
......@@ -47,8 +47,8 @@ namespace cppa { namespace detail {
template<class PartialFun>
struct projection_helper
{
PartialFun const& fun;
projection_helper(PartialFun const& pfun) : fun(pfun) { }
const PartialFun& fun;
projection_helper(const PartialFun& pfun) : fun(pfun) { }
template<typename... Args>
bool operator()(Args&&... args) const
{
......@@ -76,9 +76,9 @@ class projection
projection(fun_container&& args) : m_funs(std::move(args)) { }
projection(fun_container const& args) : m_funs(args) { }
projection(const fun_container& args) : m_funs(args) { }
projection(projection const&) = default;
projection(const projection&) = default;
/**
* @brief Invokes @p fun with a projection of <tt>args...</tt>.
......@@ -130,24 +130,24 @@ class projection
}
template<class Storage, typename Fun, typename T>
static inline bool fetch(Storage& storage, Fun const& fun, T&& arg)
static inline bool fetch(Storage& storage, const Fun& fun, T&& arg)
{
return fetch_(storage, fun(std::forward<T>(arg)));
}
template<typename Storage, typename T>
static inline bool fetch(Storage& storage, util::void_type const&, T&& arg)
static inline bool fetch(Storage& storage, const util::void_type&, T&& arg)
{
return fetch_(storage, std::forward<T>(arg));
}
static inline bool collect(tdata<>&, tdata<> const&)
static inline bool collect(tdata<>&, const tdata<>&)
{
return true;
}
template<class TData, class Trans, typename T0, typename... Ts>
static inline bool collect(TData& td, Trans const& tr,
static inline bool collect(TData& td, const Trans& tr,
T0&& arg0, Ts&&... args)
{
return fetch(td.head, tr.head, std::forward<T0>(arg0))
......@@ -165,8 +165,8 @@ class projection<util::type_list<> >
public:
projection() = default;
projection(tdata<> const&) { }
projection(projection const&) = default;
projection(const tdata<>&) { }
projection(const projection&) = default;
template<class PartialFun>
bool operator()(PartialFun& fun) const
......
......@@ -73,7 +73,7 @@ struct pseudo_tuple_from_type_list<util::type_list<Ts...> >
namespace cppa {
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type const& get(detail::pseudo_tuple<Tn...> const& tv)
const typename util::at<N, Tn...>::type& get(const detail::pseudo_tuple<Tn...>& tv)
{
static_assert(N < sizeof...(Tn), "N >= tv.size()");
return *reinterpret_cast<typename util::at<N, Tn...>::type const*>(tv.at(N));
......
......@@ -86,7 +86,7 @@ class receive_for_helper
public:
receive_for_helper(T& first, T const& last) : begin(first), end(last) { }
receive_for_helper(T& first, const T& last) : begin(first), end(last) { }
void operator()(behavior& bhvr)
{
......
......@@ -39,9 +39,9 @@ class ref_counted_impl
T m_rc;
ref_counted_impl(ref_counted_impl const&) = delete;
ref_counted_impl(const ref_counted_impl&) = delete;
ref_counted_impl& operator=(ref_counted_impl const&) = delete;
ref_counted_impl& operator=(const ref_counted_impl&) = delete;
public:
......
......@@ -51,7 +51,7 @@
namespace cppa {
class uniform_type_info;
uniform_type_info const* uniform_typeid(std::type_info const&);
uniform_type_info const* uniform_typeid(const std::type_info&);
} // namespace cppa
namespace cppa { namespace detail {
......@@ -60,7 +60,7 @@ template<typename T>
inline void* ptr_to(T& what) { return &what; }
template<typename T>
inline void const* ptr_to(T const& what) { return &what; }
inline void const* ptr_to(const T& what) { return &what; }
template<typename T>
inline void* ptr_to(T* what) { return what; }
......@@ -69,25 +69,25 @@ template<typename T>
inline void const* ptr_to(T const* what) { return what; }
template<typename T>
inline void* ptr_to(std::reference_wrapper<T> const& what)
inline void* ptr_to(const std::reference_wrapper<T>& what)
{
return &(what.get());
}
template<typename T>
inline void const* ptr_to(std::reference_wrapper<const T> const& what)
inline void const* ptr_to(const std::reference_wrapper<const T>& what)
{
return &(what.get());
}
template<typename T>
inline uniform_type_info const* utype_of(T const&)
inline uniform_type_info const* utype_of(const T&)
{
return static_types_array<T>::arr[0];
}
template<typename T>
inline uniform_type_info const* utype_of(std::reference_wrapper<T> const&)
inline uniform_type_info const* utype_of(const std::reference_wrapper<T>&)
{
return static_types_array<typename util::rm_ref<T>::type>::arr[0];
}
......@@ -167,9 +167,9 @@ struct tdata<>
tdata<>& tail() { return *this; }
tdata<> const& tail() const { return *this; }
const tdata<>& tail() const { return *this; }
tdata<> const& ctail() const { return *this; }
const tdata<>& ctail() const { return *this; }
inline void const* at(size_t) const
{
......@@ -188,7 +188,7 @@ struct tdata<>
inline void set() { }
inline bool operator==(tdata const&) const { return true; }
inline bool operator==(const tdata&) const { return true; }
inline tuple_impl_info impl_type() const
{
......@@ -200,7 +200,7 @@ struct tdata<>
template<bool IsBoxed, bool IsFunction, typename Head, typename T>
struct td_filter_
{
static inline T const& _(T const& arg) { return arg; }
static inline const T& _(const T& arg) { return arg; }
static inline T&& _(T&& arg) { return std::move(arg); }
static inline T& _(T& arg) { return arg; }
};
......@@ -214,7 +214,7 @@ struct td_filter_<false, true, Head, T>
template<typename Head, typename T>
struct td_filter_<true, false, Head, T>
{
static inline Head _(T const&) { return Head{}; }
static inline Head _(const T&) { return Head{}; }
};
template<typename Head, typename T>
......@@ -241,7 +241,7 @@ auto td_filter(T&& arg)
}
template<typename... X, typename... Y>
void tdata_set(tdata<X...>& rhs, tdata<Y...> const& lhs);
void tdata_set(tdata<X...>& rhs, const tdata<Y...>& lhs);
template<typename Head, typename... Tail>
struct tdata<Head, Tail...> : tdata<Tail...>
......@@ -270,7 +270,7 @@ struct tdata<Head, Tail...> : tdata<Tail...>
inline tdata() : super(), head() { }
//tdata(Head const& v0, Tail const&... vals) : super(vals...), head(v0) { }
//tdata(const Head& v0, const Tail&... vals) : super(vals...), head(v0) { }
tdata(Head arg) : super(), head(std::move(arg)) { }
......@@ -281,7 +281,7 @@ struct tdata<Head, Tail...> : tdata<Tail...>
{
}
tdata(tdata const&) = default;
tdata(const tdata&) = default;
tdata(tdata&& other)
: super(std::move(other.tail())), head(std::move(other.head))
......@@ -296,7 +296,7 @@ struct tdata<Head, Tail...> : tdata<Tail...>
}
template<typename... Y>
tdata(tdata<Y...> const& other) : super(other.tail()), head(other.head)
tdata(const tdata<Y...>& other) : super(other.tail()), head(other.head)
{
}
......@@ -307,7 +307,7 @@ struct tdata<Head, Tail...> : tdata<Tail...>
}
template<typename... Y>
tdata& operator=(tdata<Y...> const& other)
tdata& operator=(const tdata<Y...>& other)
{
tdata_set(*this, other);
return *this;
......@@ -334,9 +334,9 @@ struct tdata<Head, Tail...> : tdata<Tail...>
// upcast
inline tdata<Tail...>& tail() { return *this; }
inline tdata<Tail...> const& tail() const { return *this; }
inline const tdata<Tail...>& tail() const { return *this; }
inline tdata<Tail...> const& ctail() const { return *this; }
inline const tdata<Tail...>& ctail() const { return *this; }
inline void const* at(size_t p) const
{
......@@ -395,19 +395,19 @@ struct tdata<Head, Tail...> : tdata<Tail...>
return _back(token);
}
Head const& _back(std::integral_constant<size_t, 0>) const
const Head& _back(std::integral_constant<size_t, 0>) const
{
return head;
}
template<size_t Pos>
back_type const& _back(std::integral_constant<size_t, Pos>) const
const back_type& _back(std::integral_constant<size_t, Pos>) const
{
std::integral_constant<size_t, Pos - 1> token;
return super::_back(token);
}
back_type const& back() const
const back_type& back() const
{
std::integral_constant<size_t, sizeof...(Tail)> token;
return _back(token);
......@@ -415,10 +415,10 @@ struct tdata<Head, Tail...> : tdata<Tail...>
};
template<typename... X>
void tdata_set(tdata<X...>&, tdata<> const&) { }
void tdata_set(tdata<X...>&, const tdata<>&) { }
template<typename Head, typename... X, typename... Y>
void tdata_set(tdata<Head, X...>& lhs, tdata<Head, Y...> const& rhs)
void tdata_set(tdata<Head, X...>& lhs, tdata<Head, const Y...>& rhs)
{
lhs.head = rhs.head;
tdata_set(lhs.tail(), rhs.tail());
......@@ -452,13 +452,13 @@ template<typename... T>
inline void collect_tdata(tdata<T...>&) { }
template<typename Storage, typename... Args>
void collect_tdata(Storage& storage, tdata<> const&, Args const&... args)
void collect_tdata(Storage& storage, const tdata<>&, const Args&... args)
{
collect_tdata(storage, args...);
}
template<typename Storage, typename Arg0, typename... Args>
void collect_tdata(Storage& storage, Arg0 const& arg0, Args const&... args)
void collect_tdata(Storage& storage, const Arg0& arg0, const Args&... args)
{
storage.head = arg0.head;
collect_tdata(storage.tail(), arg0.tail(), args...);
......@@ -476,17 +476,17 @@ mk_tdata(Args&&... args)
}
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type const& get(detail::tdata<Tn...> const& tv)
const typename util::at<N, Tn...>::type& get(const detail::tdata<Tn...>& tv)
{
static_assert(N < sizeof...(Tn), "N >= tv.size()");
return static_cast<typename detail::tdata_upcast_helper<N, Tn...>::type const&>(tv).head;
return static_cast<const typename detail::tdata_upcast_helper<N, Tn...>::type&>(tv).head;
}
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type& get_ref(detail::tdata<Tn...>& tv)
{
static_assert(N < sizeof...(Tn), "N >= tv.size()");
return static_cast<typename detail::tdata_upcast_helper<N, Tn...>::type &>(tv).head;
return static_cast<typename detail::tdata_upcast_helper<N, Tn...>::type&>(tv).head;
}
} // namespace cppa
......
......@@ -48,7 +48,7 @@ namespace this_thread { using namespace boost::this_thread; }
template<class Lock, class Condition>
inline bool wait_until(Lock& lock, Condition& cond,
boost::system_time const& timeout)
const boost::system_time& timeout)
{
return cond.timed_wait(lock, timeout);
}
......@@ -61,7 +61,7 @@ inline boost::system_time now()
} } // namespace cppa::detail
inline boost::system_time& operator+=(boost::system_time& lhs,
cppa::util::duration const& rhs)
const cppa::util::duration& rhs)
{
switch (rhs.unit)
{
......@@ -100,7 +100,7 @@ namespace this_thread { using namespace std::this_thread; }
// returns false if a timeout occured
template<class Lock, class Condition, typename TimePoint>
inline bool wait_until(Lock& lock, Condition& cond, TimePoint const& timeout)
inline bool wait_until(Lock& lock, Condition& cond, const TimePoint& timeout)
{
return cond.wait_until(lock, timeout) != std::cv_status::timeout;
}
......
......@@ -36,8 +36,8 @@
namespace cppa { namespace detail {
std::string to_uniform_name(std::string const& demangled_name);
std::string to_uniform_name(std::type_info const& tinfo);
std::string to_uniform_name(const std::string& demangled_name);
std::string to_uniform_name(const std::type_info& tinfo);
} } // namespace cppa::detail
......
......@@ -69,14 +69,14 @@ struct tuple_cast_impl
mv)};
return {};
}
static inline option<Result> safe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> safe(any_tuple& tup, const pattern<T...>& p)
{
mapping_vector mv;
if (matches(tup, p, mv)) return {Result::from(std::move(tup.vals()),
mv)};
return {};
}
static inline option<Result> unsafe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> unsafe(any_tuple& tup, const pattern<T...>& p)
{
mapping_vector mv;
if (WP == wildcard_position::in_between)
......@@ -100,7 +100,7 @@ struct tuple_cast_impl
}
return {};
}
static inline Result force(any_tuple& tup, pattern<T...> const& p)
static inline Result force(any_tuple& tup, const pattern<T...>& p)
{
mapping_vector mv;
if (WP == wildcard_position::in_between)
......@@ -130,7 +130,7 @@ struct tuple_cast_impl<wildcard_position::nil, Result, T...>
if (matches<T...>(tup)) return {Result::from(std::move(tup.vals()))};
return {};
}
static inline option<Result> safe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> safe(any_tuple& tup, const pattern<T...>& p)
{
if (matches(tup, p))
{
......@@ -138,7 +138,7 @@ struct tuple_cast_impl<wildcard_position::nil, Result, T...>
}
return {};
}
static inline option<Result> unsafe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> unsafe(any_tuple& tup, const pattern<T...>& p)
{
if ( p.has_values() == false
|| matcher<wildcard_position::nil, any_tuple, T...>::vmatch(tup, p))
......@@ -147,7 +147,7 @@ struct tuple_cast_impl<wildcard_position::nil, Result, T...>
}
return {};
}
static inline Result force(any_tuple& tup, pattern<T...> const&)
static inline Result force(any_tuple& tup, const pattern<T...>&)
{
return {Result::from(std::move(tup.vals()))};
}
......@@ -157,7 +157,7 @@ template<class Result, typename... T>
struct tuple_cast_impl<wildcard_position::trailing, Result, T...>
: tuple_cast_impl<wildcard_position::nil, Result, T...>
{
static inline option<Result> unsafe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> unsafe(any_tuple& tup, const pattern<T...>& p)
{
if ( p.has_values() == false
|| matcher<wildcard_position::trailing, any_tuple, T...>
......@@ -167,7 +167,7 @@ struct tuple_cast_impl<wildcard_position::trailing, Result, T...>
}
return {};
}
static inline Result force(any_tuple& tup, pattern<T...> const&)
static inline Result force(any_tuple& tup, const pattern<T...>&)
{
return {Result::from(std::move(tup.vals()))};
}
......@@ -182,13 +182,13 @@ struct tuple_cast_impl<wildcard_position::leading, Result, T...>
if (matches<T...>(tup)) return {Result::offset_subtuple(tup.vals(), o)};
return {};
}
static inline option<Result> safe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> safe(any_tuple& tup, const pattern<T...>& p)
{
size_t o = tup.size() - (sizeof...(T) - 1);
if (matches(tup, p)) return {Result::offset_subtuple(tup.vals(), o)};
return {};
}
static inline option<Result> unsafe(any_tuple& tup, pattern<T...> const& p)
static inline option<Result> unsafe(any_tuple& tup, const pattern<T...>& p)
{
if ( p.has_values() == false
|| matcher<wildcard_position::leading, any_tuple, T...>
......@@ -199,7 +199,7 @@ struct tuple_cast_impl<wildcard_position::leading, Result, T...>
}
return {};
}
static inline Result force(any_tuple& tup, pattern<T...> const&)
static inline Result force(any_tuple& tup, const pattern<T...>&)
{
size_t o = tup.size() - (sizeof...(T) - 1);
return Result::offset_subtuple(tup.vals(), o);
......
......@@ -51,17 +51,17 @@ class tuple_iterator
{
}
tuple_iterator(tuple_iterator const&) = default;
tuple_iterator(const tuple_iterator&) = default;
tuple_iterator& operator=(tuple_iterator const&) = default;
tuple_iterator& operator=(const tuple_iterator&) = default;
inline bool operator==(tuple_iterator const& other) const
inline bool operator==(const tuple_iterator& other) const
{
CPPA_REQUIRE(other.m_tuple == other.m_tuple);
return other.m_pos == m_pos;
}
inline bool operator!=(tuple_iterator const& other) const
inline bool operator!=(const tuple_iterator& other) const
{
return !(*this == other);
}
......
......@@ -61,9 +61,9 @@ class tuple_vals : public abstract_tuple
tuple_vals() : super(tuple_impl_info::statically_typed), m_data() { }
tuple_vals(tuple_vals const&) = default;
tuple_vals(const tuple_vals&) = default;
tuple_vals(ElementTypes const&... args)
tuple_vals(const ElementTypes&... args)
: super(tuple_impl_info::statically_typed), m_data(args...)
{
}
......@@ -83,7 +83,7 @@ class tuple_vals : public abstract_tuple
return m_data;
}
inline data_type const& data() const
inline const data_type& data() const
{
return m_data;
}
......@@ -116,7 +116,7 @@ class tuple_vals : public abstract_tuple
return m_types[pos];
}
bool equals(abstract_tuple const& other) const
bool equals(const abstract_tuple& other) const
{
if (size() != other.size()) return false;
tuple_vals const* o = dynamic_cast<tuple_vals const*>(&other);
......
......@@ -66,7 +66,7 @@ class tuple_view : public abstract_tuple
typedef types_array<ElementTypes...> element_types;
tuple_view() = delete;
tuple_view(tuple_view const&) = delete;
tuple_view(const tuple_view&) = delete;
/**
* @warning @p tuple_view does @b NOT takes ownership for given pointers
......@@ -81,7 +81,7 @@ class tuple_view : public abstract_tuple
return m_data;
}
inline data_type const& data() const
inline const data_type& data() const
{
return m_data;
}
......
......@@ -11,7 +11,7 @@
// forward declarations
namespace cppa {
class uniform_type_info;
uniform_type_info const* uniform_typeid(std::type_info const&);
uniform_type_info const* uniform_typeid(const std::type_info&);
} // namespace cppa
namespace cppa { namespace detail {
......
......@@ -59,19 +59,19 @@ class uniform_type_info_map
~uniform_type_info_map();
inline int_map const& int_names() const
inline const int_map& int_names() const
{
return m_ints;
}
uniform_type_info* by_raw_name(std::string const& name) const;
uniform_type_info* by_raw_name(const std::string& name) const;
uniform_type_info* by_uniform_name(std::string const& name) const;
uniform_type_info* by_uniform_name(const std::string& name) const;
std::vector<uniform_type_info*> get_all() const;
// NOT thread safe!
bool insert(std::set<std::string> const& raw_names, uniform_type_info* uti);
bool insert(const std::set<std::string>& raw_names, uniform_type_info* uti);
private:
......
......@@ -43,7 +43,7 @@ namespace cppa { namespace detail {
template<bool IsFun, typename T>
struct vg_fwd_
{
static inline T const& _(T const& arg) { return arg; }
static inline const T& _(const T& arg) { return arg; }
static inline T&& _(T&& arg) { return std::move(arg); }
static inline T& _(T& arg) { return arg; }
};
......@@ -69,15 +69,14 @@ class value_guard
typename tdata_from_type_list<FilteredPattern>::type m_args;
template<typename... Args>
static inline bool _eval(util::void_type const&, tdata<> const&,
Args const&...)
static inline bool _eval(const util::void_type&, const tdata<>&, const Args&...)
{
return true;
}
template<class Tail, typename Arg0, typename... Args>
static inline bool _eval(util::void_type const&, Tail const& tail,
Arg0 const&, Args const&... args )
static inline bool _eval(const util::void_type&, const Tail& tail,
const Arg0&, const Args&... args )
{
return _eval(tail.head, tail.tail(), args...);
}
......@@ -95,8 +94,8 @@ class value_guard
}
template<typename Head, class Tail, typename Arg0, typename... Args>
static inline bool _eval(Head const& head, Tail const& tail,
Arg0 const& arg0, Args const&... args)
static inline bool _eval(const Head& head, const Tail& tail,
const Arg0& arg0, const Args&... args)
{
return cmp(head, arg0) && _eval(tail.head, tail.tail(), args...);
}
......@@ -104,15 +103,15 @@ class value_guard
public:
value_guard() = default;
value_guard(value_guard const&) = default;
value_guard(const value_guard&) = default;
template<typename... Args>
value_guard(Args const&... args) : m_args(vg_fwd<Args>::_(args)...)
value_guard(const Args&... args) : m_args(vg_fwd<Args>::_(args)...)
{
}
template<typename... Args>
inline bool operator()(Args const&... args) const
inline bool operator()(const Args&... args) const
{
return _eval(m_args.head, m_args.tail(), args...);
}
......
......@@ -62,7 +62,7 @@ class either
/**
* @brief Creates a @p Left from @p value.
*/
either(left_type const& value) : m_is_left(true) { cr_left(value); }
either(const left_type& value) : m_is_left(true) { cr_left(value); }
/**
* @brief Creates a @p Left from @p value.
......@@ -72,14 +72,14 @@ class either
/**
* @brief Creates a @p Right from @p value.
*/
either(right_type const& value) : m_is_left(false) { cr_right(value); }
either(const right_type& value) : m_is_left(false) { cr_right(value); }
/**
* @brief Creates a @p Right from @p value.
*/
either(Right&& value) : m_is_left(false) { cr_right(std::move(value)); }
either(either const& other) : m_is_left(other.m_is_left)
either(const either& other) : m_is_left(other.m_is_left)
{
if (other.m_is_left) cr_left(other.m_left);
else cr_right(other.m_right);
......@@ -93,7 +93,7 @@ class either
~either() { destroy(); }
either& operator=(either const& other)
either& operator=(const either& other)
{
if (m_is_left == other.m_is_left)
{
......@@ -149,7 +149,7 @@ class either
/**
* @brief Returns this @p either as a @p Left.
*/
inline left_type const& left() const
inline const left_type& left() const
{
CPPA_REQUIRE(m_is_left);
return m_left;
......@@ -167,7 +167,7 @@ class either
/**
* @brief Returns this @p either as a @p Right.
*/
inline right_type const& right() const
inline const right_type& right() const
{
CPPA_REQUIRE(!m_is_left);
return m_right;
......@@ -205,7 +205,7 @@ class either
/** @relates either */
template<typename Left, typename Right>
bool operator==(either<Left, Right> const& lhs, either<Left, Right> const& rhs)
bool operator==(const either<Left, Right>& lhs, const either<Left, Right>& rhs)
{
if (lhs.is_left() == rhs.is_left())
{
......@@ -217,63 +217,63 @@ bool operator==(either<Left, Right> const& lhs, either<Left, Right> const& rhs)
/** @relates either */
template<typename Left, typename Right>
bool operator==(either<Left, Right> const& lhs, Left const& rhs)
bool operator==(const either<Left, Right>& lhs, const Left& rhs)
{
return lhs.is_left() && lhs.left() == rhs;
}
/** @relates either */
template<typename Left, typename Right>
bool operator==(Left const& lhs, either<Left, Right> const& rhs)
bool operator==(const Left& lhs, const either<Left, Right>& rhs)
{
return rhs == lhs;
}
/** @relates either */
template<typename Left, typename Right>
bool operator==(either<Left, Right> const& lhs, Right const& rhs)
bool operator==(const either<Left, Right>& lhs, const Right& rhs)
{
return lhs.is_right() && lhs.right() == rhs;
}
/** @relates either */
template<typename Left, typename Right>
bool operator==(Right const& lhs, either<Left, Right> const& rhs)
bool operator==(const Right& lhs, const either<Left, Right>& rhs)
{
return rhs == lhs;
}
/** @relates either */
template<typename Left, typename Right>
bool operator!=(either<Left, Right> const& lhs, either<Left, Right> const& rhs)
bool operator!=(const either<Left, Right>& lhs, const either<Left, Right>& rhs)
{
return !(lhs == rhs);
}
/** @relates either */
template<typename Left, typename Right>
bool operator!=(either<Left, Right> const& lhs, Left const& rhs)
bool operator!=(const either<Left, Right>& lhs, const Left& rhs)
{
return !(lhs == rhs);
}
/** @relates either */
template<typename Left, typename Right>
bool operator!=(Left const& lhs, either<Left, Right> const& rhs)
bool operator!=(const Left& lhs, const either<Left, Right>& rhs)
{
return !(rhs == lhs);
}
/** @relates either */
template<typename Left, typename Right>
bool operator!=(either<Left, Right> const& lhs, Right const& rhs)
bool operator!=(const either<Left, Right>& lhs, const Right& rhs)
{
return !(lhs == rhs);
}
/** @relates either */
template<typename Left, typename Right>
bool operator!=(Right const& lhs, either<Left, Right> const& rhs)
bool operator!=(const Right& lhs, const either<Left, Right>& rhs)
{
return !(rhs == lhs);
}
......
......@@ -66,7 +66,7 @@ class exception : public std::exception
* @brief Creates an exception with the error string @p what_str.
* @param what_str Error message as string.
*/
exception(std::string const& what_str);
exception(const std::string& what_str);
private:
......@@ -107,7 +107,7 @@ class network_error : public exception
public:
network_error(std::string&& what_str);
network_error(std::string const& what_str);
network_error(const std::string& what_str);
};
......
......@@ -40,13 +40,13 @@
namespace cppa {
object from_string(std::string const& what);
object from_string(const std::string& what);
template<typename T>
T from_string(const std::string &what)
{
object o = from_string(what);
std::type_info const& tinfo = typeid(T);
const std::type_info& tinfo = typeid(T);
if (tinfo == *(o.type()))
{
return std::move(get<T>(o));
......
......@@ -47,17 +47,17 @@ template<typename...> struct pseudo_tuple;
// forward declaration of cow_tuple
template<typename...> class cow_tuple;
// forward declaration of get(detail::tdata<...> const&)
// forward declaration of get(const detail::tdata<...>&)
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type const& get(detail::tdata<Tn...> const&);
const typename util::at<N, Tn...>::type& get(const detail::tdata<Tn...>&);
// forward declarations of get(tuple<...> const&)
// forward declarations of get(const tuple<...>&)
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type const& get(cow_tuple<Tn...> const&);
const typename util::at<N, Tn...>::type& get(const cow_tuple<Tn...>&);
// forward declarations of get(detail::pseudo_tuple<...>&)
template<size_t N, typename... Tn>
typename util::at<N, Tn...>::type const& get(detail::pseudo_tuple<Tn...> const& tv);
const typename util::at<N, Tn...>::type& get(const detail::pseudo_tuple<Tn...>& tv);
// forward declarations of get_ref(detail::tdata<...>&)
template<size_t N, typename... Tn>
......@@ -73,7 +73,7 @@ typename util::at<N, Tn...>::type& get_ref(detail::pseudo_tuple<Tn...>& tv);
// support container-like access for type lists containing tokens
template<size_t N, typename... Ts>
typename util::at<N, Ts...>::type get(util::type_list<Ts...> const&)
typename util::at<N, Ts...>::type get(const util::type_list<Ts...>&)
{
return {};
}
......
......@@ -57,9 +57,9 @@ class group : public channel
group(std::string&& id, std::string&& mod_name);
group(std::string const& id, std::string const& mod_name);
group(const std::string& id, const std::string& mod_name);
virtual void unsubscribe(channel_ptr const& who) = 0;
virtual void unsubscribe(const channel_ptr& who) = 0;
public:
......@@ -79,14 +79,14 @@ class group : public channel
public:
unsubscriber(channel_ptr const& s, intrusive_ptr<group> const& g);
unsubscriber(const channel_ptr& s, const intrusive_ptr<group>& g);
~unsubscriber();
void actor_exited(std::uint32_t);
// matches on m_group
bool matches(attachable::token const& what);
bool matches(const attachable::token& what);
};
......@@ -103,7 +103,7 @@ class group : public channel
protected:
module(std::string&& module_name);
module(std::string const& module_name);
module(const std::string& module_name);
public:
......@@ -112,14 +112,14 @@ class group : public channel
* @returns The name of this module implementation.
* @threadsafe
*/
std::string const& name();
const std::string& name();
/**
* @brief Get a pointer to the group associated with
* the name @p group_name.
* @threadsafe
*/
virtual intrusive_ptr<group> get(std::string const& group_name) = 0;
virtual intrusive_ptr<group> get(const std::string& group_name) = 0;
};
......@@ -128,28 +128,28 @@ class group : public channel
* @returns The group identifier as string (e.g. "224.0.0.1" for IPv4
* multicast or a user-defined string for local groups).
*/
std::string const& identifier() const;
const std::string& identifier() const;
/**
* @brief The name of the module.
* @returns The module name of this group (e.g. "local").
*/
std::string const& module_name() const;
const std::string& module_name() const;
/**
* @brief Subscribe @p who to this group.
* @returns A {@link subscription} object that unsubscribes @p who
* if the lifetime of @p who ends.
*/
virtual subscription subscribe(channel_ptr const& who) = 0;
virtual subscription subscribe(const channel_ptr& who) = 0;
/**
* @brief Get a pointer to the group associated with
* @p group_identifier from the module @p module_name.
* @threadsafe
*/
static intrusive_ptr<group> get(std::string const& module_name,
std::string const& group_identifier);
static intrusive_ptr<group> get(const std::string& module_name,
const std::string& group_identifier);
/**
* @brief Returns an anonymous group.
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ class forward_iterator
typedef T value_type;
typedef value_type& reference;
typedef value_type const& const_reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef value_type const* const_pointer;
typedef ptrdiff_t difference_type;
......@@ -54,8 +54,8 @@ class forward_iterator
inline forward_iterator(pointer ptr = nullptr) : m_ptr(ptr) { }
forward_iterator(forward_iterator const&) = default;
forward_iterator& operator=(forward_iterator const&) = default;
forward_iterator(const forward_iterator&) = default;
forward_iterator& operator=(const forward_iterator&) = default;
inline forward_iterator& operator++()
{
......@@ -100,8 +100,8 @@ class forward_iterator
* @relates forward_iterator
*/
template<class T>
inline bool operator==(forward_iterator<T> const& lhs,
forward_iterator<T> const& rhs)
inline bool operator==(const forward_iterator<T>& lhs,
const forward_iterator<T>& rhs)
{
return lhs.ptr() == rhs.ptr();
}
......@@ -110,7 +110,7 @@ inline bool operator==(forward_iterator<T> const& lhs,
* @relates forward_iterator
*/
template<class T>
inline bool operator==(forward_iterator<T> const& lhs, T const* rhs)
inline bool operator==(const forward_iterator<T>& lhs, T const* rhs)
{
return lhs.ptr() == rhs;
}
......@@ -119,7 +119,7 @@ inline bool operator==(forward_iterator<T> const& lhs, T const* rhs)
* @relates forward_iterator
*/
template<class T>
inline bool operator==(T const* lhs, forward_iterator<T> const& rhs)
inline bool operator==(T const* lhs, const forward_iterator<T>& rhs)
{
return lhs == rhs.ptr();
}
......@@ -128,7 +128,7 @@ inline bool operator==(T const* lhs, forward_iterator<T> const& rhs)
* @relates forward_iterator
*/
template<class T>
inline bool operator==(forward_iterator<T> const& lhs, decltype(nullptr))
inline bool operator==(const forward_iterator<T>& lhs, decltype(nullptr))
{
return lhs.ptr() == nullptr;
}
......@@ -137,7 +137,7 @@ inline bool operator==(forward_iterator<T> const& lhs, decltype(nullptr))
* @relates forward_iterator
*/
template<class T>
inline bool operator==(decltype(nullptr), forward_iterator<T> const& rhs)
inline bool operator==(decltype(nullptr), const forward_iterator<T>& rhs)
{
return rhs.ptr() == nullptr;
}
......@@ -146,8 +146,8 @@ inline bool operator==(decltype(nullptr), forward_iterator<T> const& rhs)
* @relates forward_iterator
*/
template<class T>
inline bool operator!=(forward_iterator<T> const& lhs,
forward_iterator<T> const& rhs)
inline bool operator!=(const forward_iterator<T>& lhs,
const forward_iterator<T>& rhs)
{
return !(lhs == rhs);
}
......@@ -156,7 +156,7 @@ inline bool operator!=(forward_iterator<T> const& lhs,
* @relates forward_iterator
*/
template<class T>
inline bool operator!=(forward_iterator<T> const& lhs, T const* rhs)
inline bool operator!=(const forward_iterator<T>& lhs, T const* rhs)
{
return !(lhs == rhs);
}
......@@ -165,7 +165,7 @@ inline bool operator!=(forward_iterator<T> const& lhs, T const* rhs)
* @relates forward_iterator
*/
template<class T>
inline bool operator!=(T const* lhs, forward_iterator<T> const& rhs)
inline bool operator!=(T const* lhs, const forward_iterator<T>& rhs)
{
return !(lhs == rhs);
}
......@@ -174,7 +174,7 @@ inline bool operator!=(T const* lhs, forward_iterator<T> const& rhs)
* @relates forward_iterator
*/
template<class T>
inline bool operator!=(forward_iterator<T> const& lhs, decltype(nullptr))
inline bool operator!=(const forward_iterator<T>& lhs, decltype(nullptr))
{
return !(lhs == nullptr);
}
......@@ -183,7 +183,7 @@ inline bool operator!=(forward_iterator<T> const& lhs, decltype(nullptr))
* @relates forward_iterator
*/
template<class T>
inline bool operator!=(decltype(nullptr), forward_iterator<T> const& rhs)
inline bool operator!=(decltype(nullptr), const forward_iterator<T>& rhs)
{
return !(nullptr == rhs);
}
......
......@@ -77,7 +77,7 @@ class single_reader_queue
* @warning call only from the reader (owner)
*/
template<typename TimePoint>
pointer try_pop(TimePoint const& abs_time)
pointer try_pop(const TimePoint& abs_time)
{
return (timed_wait_for_data(abs_time)) ? take_head() : nullptr;
}
......@@ -165,7 +165,7 @@ class single_reader_queue
detail::condition_variable m_cv;
template<typename TimePoint>
bool timed_wait_for_data(TimePoint const& timeout)
bool timed_wait_for_data(const TimePoint& timeout)
{
if (empty())
{
......
......@@ -48,8 +48,8 @@ template<class T>
class singly_linked_list
{
singly_linked_list(singly_linked_list const&) = delete;
singly_linked_list& operator=(singly_linked_list const&) = delete;
singly_linked_list(const singly_linked_list&) = delete;
singly_linked_list& operator=(const singly_linked_list&) = delete;
public:
......@@ -57,7 +57,7 @@ class singly_linked_list
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type& reference;
typedef value_type const& const_reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef value_type const* const_pointer;
......@@ -87,7 +87,7 @@ class singly_linked_list
/**
* @brief Creates a list from given [first, last] range.
*/
static singly_linked_list from(std::pair<pointer, pointer> const& p)
static singly_linked_list from(const std::pair<pointer, pointer>& p)
{
singly_linked_list result;
result.m_head.next = p.first;
......@@ -381,9 +381,9 @@ class singly_linked_list
/**
* @brief Removes all elements that are equal to @p value.
*/
void remove(value_type const& value)
void remove(const value_type& value)
{
remove_if([&](value_type const& other) { return value == other; });
remove_if([&](const value_type& other) { return value == other; });
}
private:
......
......@@ -43,9 +43,10 @@ namespace cppa {
template<class From, class To>
struct convertible
{
constexpr convertible() { }
To convert() const
{
return static_cast<From const*>(this)->do_convert();
return static_cast<const From*>(this)->do_convert();
}
};
......@@ -54,7 +55,7 @@ struct convertible
* @relates ref_counted
*/
template<typename T>
class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
class intrusive_ptr : util::comparable<intrusive_ptr<T>, const T*>,
util::comparable<intrusive_ptr<T>>
{
......@@ -72,19 +73,19 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
intrusive_ptr(T* raw_ptr) { set_ptr(raw_ptr); }
intrusive_ptr(intrusive_ptr const& other) { set_ptr(other.m_ptr); }
intrusive_ptr(const intrusive_ptr& other) { set_ptr(other.m_ptr); }
intrusive_ptr(intrusive_ptr&& other) : m_ptr(other.take()) { }
// enables "actor_ptr s = self"
template<typename From>
intrusive_ptr(convertible<From, T*> const& from)
intrusive_ptr(const convertible<From, T*>& from)
{
set_ptr(from.convert());
}
template<typename Y>
intrusive_ptr(intrusive_ptr<Y> const& other)
intrusive_ptr(const intrusive_ptr<Y>& other)
{
static_assert(std::is_convertible<Y*, T*>::value,
"Y* is not assignable to T*");
......@@ -108,7 +109,7 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
inline T* get() { return m_ptr; }
inline T const* get() const { return m_ptr; }
inline const T* get() const { return m_ptr; }
T* take()
{
......@@ -134,7 +135,7 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
return *this;
}
intrusive_ptr& operator=(intrusive_ptr const& other)
intrusive_ptr& operator=(const intrusive_ptr& other)
{
intrusive_ptr tmp(other);
swap(tmp);
......@@ -149,7 +150,7 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
}
template<typename Y>
intrusive_ptr& operator=(intrusive_ptr<Y> const& other)
intrusive_ptr& operator=(const intrusive_ptr<Y>& other)
{
static_assert(std::is_convertible<Y*, T*>::value,
"Y* is not assignable to T*");
......@@ -179,18 +180,18 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
inline T* operator->() { return m_ptr; }
inline T const& operator*() const { return *m_ptr; }
inline const T& operator*() const { return *m_ptr; }
inline T const* operator->() const { return m_ptr; }
inline const T* operator->() const { return m_ptr; }
inline explicit operator bool() const { return m_ptr != nullptr; }
inline ptrdiff_t compare(T const* ptr) const
inline ptrdiff_t compare(const T* ptr) const
{
return static_cast<ptrdiff_t>(get() - ptr);
}
inline ptrdiff_t compare(intrusive_ptr const& other) const
inline ptrdiff_t compare(const intrusive_ptr& other) const
{
return compare(other.get());
}
......@@ -210,25 +211,25 @@ class intrusive_ptr : util::comparable<intrusive_ptr<T>, T const*>,
};
template<typename X>
inline bool operator==(intrusive_ptr<X> const& lhs, decltype(nullptr))
inline bool operator==(const intrusive_ptr<X>& lhs, decltype(nullptr))
{
return lhs.get() == nullptr;
}
template<typename X>
inline bool operator==(decltype(nullptr), intrusive_ptr<X> const& rhs)
inline bool operator==(decltype(nullptr), const intrusive_ptr<X>& rhs)
{
return rhs.get() == nullptr;
}
template<typename X, typename Y>
bool operator==(intrusive_ptr<X> const& lhs, intrusive_ptr<Y> const& rhs)
bool operator==(const intrusive_ptr<X>& lhs, const intrusive_ptr<Y>& rhs)
{
return lhs.get() == rhs.get();
}
template<typename X, typename Y>
inline bool operator!=(intrusive_ptr<X> const& lhs, intrusive_ptr<Y> const& rhs)
inline bool operator!=(const intrusive_ptr<X>& lhs, const intrusive_ptr<Y>& rhs)
{
return !(lhs == rhs);
}
......
......@@ -38,8 +38,8 @@ namespace cppa { namespace detail {
struct match_helper
{
match_helper(match_helper const&) = delete;
match_helper& operator=(match_helper const&) = delete;
match_helper(const match_helper&) = delete;
match_helper& operator=(const match_helper&) = delete;
any_tuple tup;
match_helper(any_tuple t) : tup(std::move(t)) { }
match_helper(match_helper&&) = default;
......@@ -62,8 +62,8 @@ struct match_helper
template<typename Iterator>
struct match_each_helper
{
match_each_helper(match_each_helper const&) = delete;
match_each_helper& operator=(match_each_helper const&) = delete;
match_each_helper(const match_each_helper&) = delete;
match_each_helper& operator=(const match_each_helper&) = delete;
Iterator i;
Iterator e;
match_each_helper(Iterator first, Iterator last) : i(first), e(last) { }
......@@ -87,8 +87,8 @@ struct match_each_helper
template<class Container>
struct copying_match_each_helper
{
copying_match_each_helper(copying_match_each_helper const&) = delete;
copying_match_each_helper& operator=(copying_match_each_helper const&) = delete;
copying_match_each_helper(const copying_match_each_helper&) = delete;
copying_match_each_helper& operator=(const copying_match_each_helper&) = delete;
Container vec;
copying_match_each_helper(Container tmp) : vec(std::move(tmp)) { }
copying_match_each_helper(copying_match_each_helper&&) = default;
......@@ -111,8 +111,8 @@ struct copying_match_each_helper
template<typename Iterator, typename Projection>
struct pmatch_each_helper
{
pmatch_each_helper(pmatch_each_helper const&) = delete;
pmatch_each_helper& operator=(pmatch_each_helper const&) = delete;
pmatch_each_helper(const pmatch_each_helper&) = delete;
pmatch_each_helper& operator=(const pmatch_each_helper&) = delete;
Iterator i;
Iterator e;
Projection p;
......
This diff is collapsed.
......@@ -44,11 +44,11 @@ namespace cppa {
// forward declarations
class object;
bool operator==(object const& lhs, object const& rhs);
bool operator==(const object& lhs, const object& rhs);
class uniform_type_info;
uniform_type_info const* uniform_typeid(std::type_info const&);
bool operator==(uniform_type_info const& lhs, std::type_info const& rhs);
uniform_type_info const* uniform_typeid(const std::type_info&);
bool operator==(const uniform_type_info& lhs, const std::type_info& rhs);
/**
* @brief Grants mutable access to the stored value of @p obj.
......@@ -68,7 +68,7 @@ T& get_ref(object& obj);
* @throws std::invalid_argument if <tt>obj.type() != typeid(T)</tt>
*/
template<typename T>
T const& get(object const& obj);
const T& get(const object& obj);
/**
* @brief An abstraction class that stores an instance of
......@@ -77,7 +77,7 @@ T const& get(object const& obj);
class object
{
friend bool operator==(object const& lhs, object const& rhs);
friend bool operator==(const object& lhs, const object& rhs);
public:
......@@ -106,7 +106,7 @@ class object
* @brief Creates a (deep) copy of @p other.
* @post {*this == other}
*/
object(object const& other);
object(const object& other);
/**
* @brief Moves the content from @p other to this.
......@@ -118,7 +118,7 @@ class object
* @brief Creates a (deep) copy of @p other and assigns it to @p this.
* @return @p *this
*/
object& operator=(object const& other);
object& operator=(const object& other);
/**
* @brief Gets the RTTI of this object.
......@@ -130,7 +130,7 @@ class object
/**
* @brief Gets the stored value.
* @returns A const pointer to the currently stored value.
* @see get(object const&)
* @see get(const object&)
*/
void const* value() const;
......@@ -169,7 +169,7 @@ object object::from(T&& what)
return { new value_type(std::forward<T>(what)), rtti };
}
inline bool operator!=(object const& lhs, object const& rhs)
inline bool operator!=(const object& lhs, const object& rhs)
{
return !(lhs == rhs);
}
......@@ -187,7 +187,7 @@ T& get_ref(object& obj)
}
template<typename T>
T const& get(object const& obj)
const T& get(const object& obj)
{
static_assert(!std::is_pointer<T>::value && !std::is_reference<T>::value,
"T is a reference or a pointer type.");
......
......@@ -104,7 +104,7 @@ class behavior_rvalue_builder
public:
constexpr behavior_rvalue_builder(util::duration const& d) : m_timeout(d)
constexpr behavior_rvalue_builder(const util::duration& d) : m_timeout(d)
{
}
......@@ -158,7 +158,7 @@ struct rvalue_builder
rvalue_builder() = default;
template<typename... Args>
rvalue_builder(rvalue_builder_args_ctor, Args const&... args)
rvalue_builder(rvalue_builder_args_ctor, const Args&... args)
: m_guard(args...)
, m_funs(args...)
{
......@@ -288,7 +288,7 @@ constexpr anything any_vals;
* {@link cppa::any_vals any_vals} and {@link cppa::arg_match arg_match}.
*/
template<typename Arg0, typename... Args>
___ on(Arg0 const& arg0, Args const&... args);
___ on(const Arg0& arg0, const Args&... args);
/**
* @brief Left-hand side of a partial function expression that matches types.
......@@ -340,7 +340,7 @@ detail::rvalue_builder<
>::type,
util::type_list<typename detail::pattern_type<Arg0>::type,
typename detail::pattern_type<Args>::type...> >
on(Arg0 const& arg0, Args const&... args)
on(const Arg0& arg0, const Args&... args)
{
return {detail::rvalue_builder_args_ctor{}, arg0, args...};
}
......@@ -381,7 +381,7 @@ decltype(on(A0, A1, A2, A3, val<Ts>()...)) on()
template<class Rep, class Period>
constexpr detail::behavior_rvalue_builder
after(std::chrono::duration<Rep, Period> const& d)
after(const std::chrono::duration<Rep, Period>& d)
{
return { util::duration(d) };
}
......
......@@ -63,7 +63,7 @@ class option
*/
option(T value) : m_valid(false) { cr(std::move(value)); }
option(option const& other) : m_valid(false)
option(const option& other) : m_valid(false)
{
if (other.m_valid) cr(other.m_value);
}
......@@ -75,7 +75,7 @@ class option
~option() { destroy(); }
option& operator=(option const& other)
option& operator=(const option& other)
{
if (m_valid)
{
......@@ -103,7 +103,7 @@ class option
return *this;
}
option& operator=(T const& value)
option& operator=(const T& value)
{
if (m_valid) m_value = value;
else cr(value);
......@@ -147,7 +147,7 @@ class option
/**
* @brief Returns the value.
*/
inline T const& operator*() const
inline const T& operator*() const
{
CPPA_REQUIRE(valid());
return m_value;
......@@ -165,7 +165,7 @@ class option
/**
* @brief Returns the value.
*/
inline T const& get() const
inline const T& get() const
{
CPPA_REQUIRE(valid());
return m_value;
......@@ -208,7 +208,7 @@ class option
/** @relates option */
template<typename T, typename U>
bool operator==(option<T> const& lhs, option<U> const& rhs)
bool operator==(const option<T>& lhs, const option<U>& rhs)
{
if ((lhs) && (rhs)) return *lhs == *rhs;
return false;
......@@ -216,7 +216,7 @@ bool operator==(option<T> const& lhs, option<U> const& rhs)
/** @relates option */
template<typename T, typename U>
bool operator==(option<T> const& lhs, U const& rhs)
bool operator==(const option<T>& lhs, const U& rhs)
{
if (lhs) return *lhs == rhs;
return false;
......@@ -224,28 +224,28 @@ bool operator==(option<T> const& lhs, U const& rhs)
/** @relates option */
template<typename T, typename U>
bool operator==(T const& lhs, option<U> const& rhs)
bool operator==(const T& lhs, const option<U>& rhs)
{
return rhs == lhs;
}
/** @relates option */
template<typename T, typename U>
bool operator!=(option<T> const& lhs, option<U> const& rhs)
bool operator!=(const option<T>& lhs, const option<U>& rhs)
{
return !(lhs == rhs);
}
/** @relates option */
template<typename T, typename U>
bool operator!=(option<T> const& lhs, U const& rhs)
bool operator!=(const option<T>& lhs, const U& rhs)
{
return !(lhs == rhs);
}
/** @relates option */
template<typename T, typename U>
bool operator!=(T const& lhs, option<U> const& rhs)
bool operator!=(const T& lhs, const option<U>& rhs)
{
return !(lhs == rhs);
}
......
......@@ -50,8 +50,8 @@ class behavior;
class partial_function
{
partial_function(partial_function const&) = delete;
partial_function& operator=(partial_function const&) = delete;
partial_function(const partial_function&) = delete;
partial_function& operator=(const partial_function&) = delete;
public:
......@@ -59,8 +59,8 @@ class partial_function
{
virtual ~impl();
virtual bool invoke(any_tuple&) = 0;
virtual bool invoke(any_tuple const&) = 0;
virtual bool defined_at(any_tuple const&) = 0;
virtual bool invoke(const any_tuple&) = 0;
virtual bool defined_at(const any_tuple&) = 0;
};
typedef std::unique_ptr<impl> impl_ptr;
......@@ -71,7 +71,7 @@ class partial_function
partial_function(impl_ptr&& ptr);
inline bool defined_at(any_tuple const& value)
inline bool defined_at(const any_tuple& value)
{
return ((m_impl) && m_impl->defined_at(value));
}
......@@ -81,7 +81,7 @@ class partial_function
return ((m_impl) && m_impl->invoke(value));
}
inline bool operator()(any_tuple const& value)
inline bool operator()(const any_tuple& value)
{
return ((m_impl) && m_impl->invoke(value));
}
......
......@@ -87,32 +87,32 @@ struct value_matcher
const bool is_dummy;
inline value_matcher(bool dummy_impl = false) : is_dummy(dummy_impl) { }
virtual ~value_matcher();
virtual bool operator()(any_tuple const&) const = 0;
virtual bool operator()(const any_tuple&) const = 0;
};
struct dummy_matcher : value_matcher
{
inline dummy_matcher() : value_matcher(true) { }
bool operator()(any_tuple const&) const;
bool operator()(const any_tuple&) const;
};
struct cmp_helper
{
size_t i;
any_tuple const& tup;
cmp_helper(any_tuple const& tp, size_t pos = 0) : i(pos), tup(tp) { }
const any_tuple& tup;
cmp_helper(const any_tuple& tp, size_t pos = 0) : i(pos), tup(tp) { }
template<typename T>
inline bool operator()(T const& what)
inline bool operator()(const T& what)
{
return what == tup.get_as<T>(i++);
}
template<typename T>
inline bool operator()(std::unique_ptr<util::guard<T> > const& g)
inline bool operator()(std::unique_ptr<util::guard<T> const >& g)
{
return (*g)(tup.get_as<T>(i++));
}
template<typename T>
inline bool operator()(util::wrapped<T> const&)
inline bool operator()(const util::wrapped<T>&)
{
++i;
return true;
......@@ -135,7 +135,7 @@ class value_matcher_impl<wildcard_position::nil,
template<typename... Args>
value_matcher_impl(Args&&... args) : m_values(std::forward<Args>(args)...) { }
bool operator()(any_tuple const& tup) const
bool operator()(const any_tuple& tup) const
{
cmp_helper h{tup};
return util::static_foreach<0, sizeof...(Vs)>::eval(m_values, h);
......@@ -177,7 +177,7 @@ class value_matcher_impl<wildcard_position::leading,
template<typename... Args>
value_matcher_impl(Args&&... args) : m_values(std::forward<Args>(args)...) { }
bool operator()(any_tuple const& tup) const
bool operator()(const any_tuple& tup) const
{
cmp_helper h{tup, tup.size() - sizeof...(Ts)};
return util::static_foreach<0, sizeof...(Vs)>::eval(m_values, h);
......@@ -198,7 +198,7 @@ class value_matcher_impl<wildcard_position::in_between,
template<typename... Args>
value_matcher_impl(Args&&... args) : m_values(std::forward<Args>(args)...) { }
bool operator()(any_tuple const& tup) const
bool operator()(const any_tuple& tup) const
{
static constexpr size_t wcpos =
static_cast<size_t>(util::tl_find<util::type_list<Ts...>, anything>::value);
......@@ -225,7 +225,7 @@ class value_matcher_impl<wildcard_position::multiple,
template<typename... Args>
value_matcher_impl(Args&&...) { }
bool operator()(any_tuple const&) const
bool operator()(const any_tuple&) const
{
throw std::runtime_error("not implemented yet, sorry");
}
......@@ -238,8 +238,8 @@ class pattern
static_assert(sizeof...(Types) > 0, "empty pattern");
pattern(pattern const&) = delete;
pattern& operator=(pattern const&) = delete;
pattern(const pattern&) = delete;
pattern& operator=(const pattern&) = delete;
public:
......@@ -286,7 +286,7 @@ class pattern
inline bool has_values() const { return m_vm->is_dummy == false; }
// @warning does NOT check types
bool _matches_values(any_tuple const& tup) const
bool _matches_values(const any_tuple& tup) const
{
return (*m_vm)(tup);
}
......@@ -302,13 +302,13 @@ class pattern
}
template<typename... Args>
pattern(util::wrapped<head_type> const& arg0, Args&&... args)
pattern(const util::wrapped<head_type>& arg0, Args&&... args)
: m_vm(get_value_matcher(arg0, std::forward<Args>(args)...))
{
}
template<typename... Args>
pattern(detail::tdata<Args...> const& data)
pattern(const detail::tdata<Args...>& data)
{
m_vm.reset(new value_matcher_impl<wildcard_pos, types, util::type_list<Args...> >{data});
}
......@@ -354,7 +354,7 @@ class pattern
init_helper(tvp_array& ptrs, detail::types_array<Types...>& tarr)
: i(0), m_ptrs(ptrs), m_arr(tarr) { }
template<typename T>
inline void operator()(option<T> const& what)
inline void operator()(const option<T>& what)
{
m_ptrs[i].first = m_arr[i];
m_ptrs[i].second = (what) ? &(*what) : nullptr;
......
......@@ -62,7 +62,7 @@ namespace cppa {
class primitive_variant;
template<typename T>
T const& get(primitive_variant const& pv);
const T& get(const primitive_variant& pv);
template<typename T>
T& get_ref(primitive_variant& pv);
......@@ -74,11 +74,11 @@ T& get_ref(primitive_variant& pv);
class primitive_variant
{
friend bool operator==(primitive_variant const& lhs,
primitive_variant const& rhs);
friend bool operator==(const primitive_variant& lhs,
const primitive_variant& rhs);
template<typename T>
friend T const& get(primitive_variant const& pv);
friend const T& get(const primitive_variant& pv);
template<typename T>
friend T& get_ref(primitive_variant& pv);
......@@ -213,7 +213,7 @@ class primitive_variant
* @brief Creates a copy from @p other.
* @param other A primitive variant.
*/
primitive_variant(primitive_variant const& other);
primitive_variant(const primitive_variant& other);
/**
* @brief Creates a new variant and move the value from @p other to it.
......@@ -251,7 +251,7 @@ class primitive_variant
* @param other A primitive variant.
* @returns <tt>*this</tt>.
*/
primitive_variant& operator=(primitive_variant const& other);
primitive_variant& operator=(const primitive_variant& other);
/**
* @brief Moves the content of @p other to @p this.
......@@ -272,7 +272,7 @@ class primitive_variant
* otherwise typeid(T) is returned, where T is the C++ type
* of @p this.
*/
std::type_info const& type() const;
const std::type_info& type() const;
~primitive_variant();
......@@ -287,7 +287,7 @@ class primitive_variant
* @throws std::logic_error if @p pv is not of type @p T.
*/
template<typename T>
T const& get(primitive_variant const& pv)
const T& get(const primitive_variant& pv)
{
static const primitive_type ptype = detail::type_to_ptype<T>::ptype;
return pv.get_as<ptype>();
......@@ -319,7 +319,7 @@ T& get_ref(primitive_variant& pv)
* @returns A const reference to the value of @p pv of type @p T.
*/
template<primitive_type PT>
T const& get_ref(primitive_variant const& pv);
const T& get_ref(const primitive_variant& pv);
/**
* @ingroup TypeSystem
......@@ -336,7 +336,7 @@ T& get_ref(primitive_variant& pv);
template<primitive_type PT>
inline const typename detail::ptype_to_type<PT>::type&
get(primitive_variant const& pv)
get(const primitive_variant& pv)
{
static_assert(PT != pt_null, "PT == pt_null");
return get<typename detail::ptype_to_type<PT>::type>(pv);
......@@ -352,17 +352,17 @@ get_ref(primitive_variant& pv)
#endif
bool operator==(primitive_variant const& lhs, primitive_variant const& rhs);
bool operator==(const primitive_variant& lhs, const primitive_variant& rhs);
inline
bool operator!=(primitive_variant const& lhs, primitive_variant const& rhs)
bool operator!=(const primitive_variant& lhs, const primitive_variant& rhs)
{
return !(lhs == rhs);
}
template<typename T>
typename std::enable_if<util::is_primitive<T>::value, bool>::type
operator==(T const& lhs, primitive_variant const& rhs)
operator==(const T& lhs, const primitive_variant& rhs)
{
static constexpr primitive_type ptype = detail::type_to_ptype<T>::ptype;
static_assert(ptype != pt_null, "T is an incompatible type");
......@@ -371,21 +371,21 @@ operator==(T const& lhs, primitive_variant const& rhs)
template<typename T>
typename std::enable_if<util::is_primitive<T>::value, bool>::type
operator==(primitive_variant const& lhs, T const& rhs)
operator==(const primitive_variant& lhs, const T& rhs)
{
return (rhs == lhs);
}
template<typename T>
typename std::enable_if<util::is_primitive<T>::value, bool>::type
operator!=(primitive_variant const& lhs, T const& rhs)
operator!=(const primitive_variant& lhs, const T& rhs)
{
return !(lhs == rhs);
}
template<typename T>
typename std::enable_if<util::is_primitive<T>::value, bool>::type
operator!=(T const& lhs, primitive_variant const& rhs)
operator!=(const T& lhs, const primitive_variant& rhs)
{
return !(lhs == rhs);
}
......
......@@ -65,21 +65,21 @@ class process_information : public ref_counted,
/**
* @brief Copy constructor.
*/
process_information(process_information const&);
process_information(const process_information&);
/**
* @brief Creates @c this from @p process_id and @p hash.
* @param process_id System-wide unique process identifier.
* @param hash Unique node id as hexadecimal string representation.
*/
process_information(std::uint32_t process_id, std::string const& hash);
process_information(std::uint32_t process_id, const std::string& hash);
/**
* @brief Creates @c this from @p process_id and @p hash.
* @param process_id System-wide unique process identifier.
* @param hash Unique node id.
*/
process_information(std::uint32_t process_id, node_id_type const& node_id);
process_information(std::uint32_t process_id, const node_id_type& node_id);
/**
* @brief Identifies the running process.
......@@ -92,16 +92,16 @@ class process_information : public ref_counted,
* @returns A hash build from the MAC address of the first network device
* and the UUID of the root partition (mounted in "/" or "C:").
*/
inline node_id_type const& node_id() const { return m_node_id; }
inline const node_id_type& node_id() const { return m_node_id; }
/**
* @brief Returns the proccess_information for the running process.
* @returns A pointer to the singleton of this process.
*/
static intrusive_ptr<process_information> const& get();
static const intrusive_ptr<process_information>& get();
// "inherited" from comparable<process_information>
int compare(process_information const& other) const;
int compare(const process_information& other) const;
private:
......@@ -110,19 +110,19 @@ class process_information : public ref_counted,
};
void node_id_from_string(std::string const& hash,
void node_id_from_string(const std::string& hash,
process_information::node_id_type& node_id);
bool equal(std::string const& hash,
process_information::node_id_type const& node_id);
bool equal(const std::string& hash,
const process_information::node_id_type& node_id);
inline bool equal(process_information::node_id_type const& node_id,
std::string const& hash)
inline bool equal(const process_information::node_id_type& node_id,
const std::string& hash)
{
return equal(hash, node_id);
}
std::string to_string(process_information const& what);
std::string to_string(const process_information& what);
/**
* @brief Converts a {@link process_information::node_id_type node_id}
......@@ -130,7 +130,7 @@ std::string to_string(process_information const& what);
* @param node_id A unique node identifier.
* @returns A hexadecimal representation of @p node_id.
*/
std::string to_string(process_information::node_id_type const& node_id);
std::string to_string(const process_information::node_id_type& node_id);
/**
* @brief A smart pointer type that manages instances of
......
......@@ -93,7 +93,7 @@ auto receive_while(Statement&& stmt);
* @returns A functor implementing the loop.
*/
template<typename T>
auto receive_for(T& begin, T const& end);
auto receive_for(T& begin, const T& end);
/**
* @brief Receives messages until @p stmt returns true.
......@@ -142,7 +142,7 @@ void receive_loop(Arg0&& arg0, Args&&... args)
}
template<typename T>
detail::receive_for_helper<T> receive_for(T& begin, T const& end)
detail::receive_for_helper<T> receive_for(T& begin, const T& end)
{
return {begin, end};
}
......
......@@ -116,8 +116,8 @@ class scheduler
virtual attachable* register_hidden_context();
template<typename Duration, typename... Data>
void future_send(actor_ptr const& to,
Duration const& rel_time, Data const&... data)
void future_send(const actor_ptr& to,
const Duration& rel_time, const Data&... data)
{
static_assert(sizeof...(Data) > 0, "no message to send");
any_tuple data_tup = make_cow_tuple(data...);
......
......@@ -60,8 +60,8 @@ class self_type : public convertible<self_type, actor*>
static actor* convert_impl();
self_type(self_type const&) = delete;
self_type& operator=(self_type const&) = delete;
self_type(const self_type&) = delete;
self_type& operator=(const self_type&) = delete;
public:
......
......@@ -49,8 +49,8 @@ class primitive_variant;
class serializer
{
serializer(serializer const&) = delete;
serializer& operator=(serializer const&) = delete;
serializer(const serializer&) = delete;
serializer& operator=(const serializer&) = delete;
public:
......@@ -63,7 +63,7 @@ class serializer
* named @p type_name.
* @param type_name The platform-independent @p libcppa type name.
*/
virtual void begin_object(std::string const& type_name) = 0;
virtual void begin_object(const std::string& type_name) = 0;
/**
* @brief Ends serialization of an object.
......@@ -84,7 +84,7 @@ class serializer
* @brief Writes a single value to the data sink.
* @param value A primitive data value.
*/
virtual void write_value(primitive_variant const& value) = 0;
virtual void write_value(const primitive_variant& value) = 0;
/**
* @brief Writes @p num values as a tuple to the data sink.
......@@ -96,7 +96,7 @@ class serializer
};
template<typename T>
serializer& operator<<(serializer& s, T const& what)
serializer& operator<<(serializer& s, const T& what)
{
auto mtype = uniform_typeid<T>();
if (mtype == nullptr)
......
......@@ -48,7 +48,7 @@ std::string to_string_impl(void const* what, uniform_type_info const* utype);
* @returns A string representation of @p what.
*/
template<typename T>
std::string to_string(T const& what)
std::string to_string(const T& what)
{
auto utype = uniform_typeid<T>();
if (utype == nullptr)
......
......@@ -76,9 +76,9 @@ class tpartial_function
{
}
tpartial_function(tpartial_function const&) = default;
tpartial_function(const tpartial_function&) = default;
//bool defined_at(typename util::rm_ref<Args>::type const&... args) const
//bool defined_at(const typename util::rm_ref<Args>::type&... args) const
bool defined_at(Args... args) const
{
return m_guard(args...);
......@@ -126,7 +126,7 @@ struct get_tpartial_function<Expr, Guard,
typename ctrait::arg_types,
sizeof...(Args)
>::type,
util::type_list<Args const&...>,
util::type_list<const Args&...>,
util::left_or_right
>::type,
typename ctrait::result_type,
......
......@@ -46,7 +46,7 @@ namespace cppa {
* of @p tup on success.
*/
template<typename... T>
auto moving_tuple_cast(any_tuple& tup, pattern<T...> const& p)
auto moving_tuple_cast(any_tuple& tup, const pattern<T...>& p)
-> option<
typename cow_tuple_from_type_list<
typename pattern<T...>::filtered_types
......@@ -79,7 +79,7 @@ auto moving_tuple_cast(any_tuple& tup)
}
template<typename... T>
auto moving_tuple_cast(any_tuple& tup, util::type_list<T...> const&)
auto moving_tuple_cast(any_tuple& tup, const util::type_list<T...>&)
-> decltype(moving_tuple_cast<T...>(tup))
{
return moving_tuple_cast<T...>(tup);
......@@ -89,7 +89,7 @@ auto moving_tuple_cast(any_tuple& tup, util::type_list<T...> const&)
* @brief Tries to cast @p tup to {@link tuple tuple<T...>}.
*/
template<typename... T>
auto tuple_cast(any_tuple tup, pattern<T...> const& p)
auto tuple_cast(any_tuple tup, const pattern<T...>& p)
-> option<
typename cow_tuple_from_type_list<
typename pattern<T...>::filtered_types
......@@ -113,7 +113,7 @@ auto tuple_cast(any_tuple tup)
}
template<typename... T>
auto tuple_cast(any_tuple tup, util::type_list<T...> const&)
auto tuple_cast(any_tuple tup, const util::type_list<T...>&)
-> decltype(tuple_cast<T...>(tup))
{
return moving_tuple_cast<T...>(tup);
......@@ -123,7 +123,7 @@ auto tuple_cast(any_tuple tup, util::type_list<T...> const&)
// (moving) cast using a pattern; does not perform type checking
template<typename... T>
auto unsafe_tuple_cast(any_tuple& tup, pattern<T...> const& p)
auto unsafe_tuple_cast(any_tuple& tup, const pattern<T...>& p)
-> option<
typename cow_tuple_from_type_list<
typename pattern<T...>::filtered_types
......@@ -137,7 +137,7 @@ auto unsafe_tuple_cast(any_tuple& tup, pattern<T...> const& p)
}
template<typename... T>
auto unsafe_tuple_cast(any_tuple& tup, util::type_list<T...> const&)
auto unsafe_tuple_cast(any_tuple& tup, const util::type_list<T...>&)
-> decltype(tuple_cast<T...>(tup))
{
return tuple_cast<T...>(tup);
......@@ -145,7 +145,7 @@ auto unsafe_tuple_cast(any_tuple& tup, util::type_list<T...> const&)
// cast using a pattern; does neither perform type checking nor checks values
template<typename... T>
auto forced_tuple_cast(any_tuple& tup, pattern<T...> const& p)
auto forced_tuple_cast(any_tuple& tup, const pattern<T...>& p)
-> typename cow_tuple_from_type_list<
typename pattern<T...>::filtered_types
>::type
......
......@@ -49,18 +49,18 @@ class type_value_pair_const_iterator
typedef type_value_pair const value_type;
typedef std::ptrdiff_t difference_type;
typedef type_value_pair const* pointer;
typedef type_value_pair const& reference;
typedef const type_value_pair& reference;
typedef std::bidirectional_iterator_tag iterator_category;
constexpr type_value_pair_const_iterator() : iter(nullptr) { }
type_value_pair_const_iterator(type_value_pair const* i) : iter(i) { }
type_value_pair_const_iterator(type_value_pair_const_iterator const&)
type_value_pair_const_iterator(const type_value_pair_const_iterator&)
= default;
type_value_pair_const_iterator&
operator=(type_value_pair_const_iterator const&) = default;
operator=(const type_value_pair_const_iterator&) = default;
inline uniform_type_info const* type() const { return iter->first; }
......@@ -114,8 +114,8 @@ class type_value_pair_const_iterator
/**
* @relates type_value_pair_const_iterator
*/
inline bool operator==(type_value_pair_const_iterator const& lhs,
type_value_pair_const_iterator const& rhs)
inline bool operator==(const type_value_pair_const_iterator& lhs,
const type_value_pair_const_iterator& rhs)
{
return lhs.base() == rhs.base();
}
......@@ -123,8 +123,8 @@ inline bool operator==(type_value_pair_const_iterator const& lhs,
/**
* @relates type_value_pair_const_iterator
*/
inline bool operator!=(type_value_pair_const_iterator const& lhs,
type_value_pair_const_iterator const& rhs)
inline bool operator!=(const type_value_pair_const_iterator& lhs,
const type_value_pair_const_iterator& rhs)
{
return !(lhs == rhs);
}
......
......@@ -52,7 +52,7 @@ class serializer;
class deserializer;
class uniform_type_info;
uniform_type_info const* uniform_typeid(std::type_info const&);
uniform_type_info const* uniform_typeid(const std::type_info&);
/**
* @defgroup TypeSystem libcppa's platform-independent type system.
......@@ -150,16 +150,16 @@ class uniform_type_info
friend class object;
friend bool operator==(uniform_type_info const& lhs,
uniform_type_info const& rhs);
friend bool operator==(const uniform_type_info& lhs,
const uniform_type_info& rhs);
// disable copy and move constructors
uniform_type_info(uniform_type_info&&) = delete;
uniform_type_info(uniform_type_info const&) = delete;
uniform_type_info(const uniform_type_info&) = delete;
// disable assignment operators
uniform_type_info& operator=(uniform_type_info&&) = delete;
uniform_type_info& operator=(uniform_type_info const&) = delete;
uniform_type_info& operator=(const uniform_type_info&) = delete;
public:
......@@ -171,7 +171,7 @@ class uniform_type_info
* @returns The instance associated to @p uniform_name.
* @throws std::runtime_error if no type named @p uniform_name was found.
*/
static uniform_type_info* from(std::string const& uniform_name);
static uniform_type_info* from(const std::string& uniform_name);
/**
* @brief Get instance by std::type_info.
......@@ -179,7 +179,7 @@ class uniform_type_info
* @returns An instance describing the same type as @p tinfo.
* @throws std::runtime_error if @p tinfo is not an announced type.
*/
static uniform_type_info const* from(std::type_info const& tinfo);
static uniform_type_info const* from(const std::type_info& tinfo);
/**
* @brief Get all instances.
......@@ -191,7 +191,7 @@ class uniform_type_info
* @brief Get the internal @p libcppa name for this type.
* @returns A string describing the @p libcppa internal type name.
*/
inline std::string const& name() const { return m_name; }
inline const std::string& name() const { return m_name; }
/**
* @brief Creates an object of this type.
......@@ -208,7 +208,7 @@ class uniform_type_info
* type than @p tinfo.
* @returns @p true if @p tinfo describes the same type as @p this.
*/
virtual bool equals(std::type_info const& tinfo) const = 0;
virtual bool equals(const std::type_info& tinfo) const = 0;
/**
* @brief Compares two instances of this type.
......@@ -237,7 +237,7 @@ class uniform_type_info
protected:
uniform_type_info(std::string const& uniform_name);
uniform_type_info(const std::string& uniform_name);
/**
* @brief Casts @p instance to the native type and deletes it.
......@@ -275,8 +275,8 @@ inline uniform_type_info const* uniform_typeid()
/**
* @relates uniform_type_info
*/
inline bool operator==(uniform_type_info const& lhs,
uniform_type_info const& rhs)
inline bool operator==(const uniform_type_info& lhs,
const uniform_type_info& rhs)
{
// uniform_type_info instances are singletons,
// thus, equal == identical
......@@ -286,8 +286,8 @@ inline bool operator==(uniform_type_info const& lhs,
/**
* @relates uniform_type_info
*/
inline bool operator!=(uniform_type_info const& lhs,
uniform_type_info const& rhs)
inline bool operator!=(const uniform_type_info& lhs,
const uniform_type_info& rhs)
{
return !(lhs == rhs);
}
......@@ -295,7 +295,7 @@ inline bool operator!=(uniform_type_info const& lhs,
/**
* @relates uniform_type_info
*/
inline bool operator==(uniform_type_info const& lhs, std::type_info const& rhs)
inline bool operator==(const uniform_type_info& lhs, const std::type_info& rhs)
{
return lhs.equals(rhs);
}
......@@ -303,7 +303,7 @@ inline bool operator==(uniform_type_info const& lhs, std::type_info const& rhs)
/**
* @relates uniform_type_info
*/
inline bool operator!=(uniform_type_info const& lhs, std::type_info const& rhs)
inline bool operator!=(const uniform_type_info& lhs, const std::type_info& rhs)
{
return !(lhs.equals(rhs));
}
......@@ -311,7 +311,7 @@ inline bool operator!=(uniform_type_info const& lhs, std::type_info const& rhs)
/**
* @relates uniform_type_info
*/
inline bool operator==(std::type_info const& lhs, uniform_type_info const& rhs)
inline bool operator==(const std::type_info& lhs, const uniform_type_info& rhs)
{
return rhs.equals(lhs);
}
......@@ -319,7 +319,7 @@ inline bool operator==(std::type_info const& lhs, uniform_type_info const& rhs)
/**
* @relates uniform_type_info
*/
inline bool operator!=(std::type_info const& lhs, uniform_type_info const& rhs)
inline bool operator!=(const std::type_info& lhs, const uniform_type_info& rhs)
{
return !(rhs.equals(lhs));
}
......
......@@ -44,7 +44,7 @@ template<typename T>
class abstract_uniform_type_info : public uniform_type_info
{
inline static T const& deref(void const* ptr)
inline static const T& deref(void const* ptr)
{
return *reinterpret_cast<T const*>(ptr);
}
......@@ -56,7 +56,7 @@ class abstract_uniform_type_info : public uniform_type_info
protected:
abstract_uniform_type_info(std::string const& uname
abstract_uniform_type_info(const std::string& uname
= detail::to_uniform_name(typeid(T)))
: uniform_type_info(uname)
{
......@@ -79,7 +79,7 @@ class abstract_uniform_type_info : public uniform_type_info
public:
bool equals(std::type_info const& tinfo) const
bool equals(const std::type_info& tinfo) const
{
return typeid(T) == tinfo;
}
......
......@@ -39,7 +39,7 @@ template<typename Result, size_t NumFunctorArgs, size_t NumArgs>
struct apply_args
{
template<class Fun, typename Arg0, typename... Args>
static Result _(Fun const& fun, Arg0&&, Args&&... args)
static Result _(const Fun& fun, Arg0&&, Args&&... args)
{
return apply_args<Result, NumFunctorArgs, sizeof...(Args)>
::_(fun, std::forward<Args>(args)...);
......@@ -50,7 +50,7 @@ template<typename Result, size_t X>
struct apply_args<Result, X, X>
{
template<class Fun, typename... Args>
static Result _(Fun const& fun, Args&&... args)
static Result _(const Fun& fun, Args&&... args)
{
return fun(std::forward<Args>(args)...);
}
......
......@@ -43,7 +43,7 @@ template<typename Result, bool IsManipulator, size_t... Range>
struct apply_tuple_impl
{
template<typename F, class Tuple>
static inline Result apply(F& f, Tuple const& args)
static inline Result apply(F& f, const Tuple& args)
{
return f(get<Range>(args)...);
}
......@@ -75,7 +75,7 @@ template<typename Result, bool IsManipulator>
struct apply_tuple_util<Result, IsManipulator, 1, 0>
{
template<typename F, class Unused>
static Result apply(F& f, Unused const&)
static Result apply(F& f, const Unused&)
{
return f();
}
......@@ -97,7 +97,7 @@ typename get_result_type<F>::type apply_tuple(F&& fun, Tuple<T...>& tup)
}
template<typename F, template<typename...> class Tuple, typename... T>
typename get_result_type<F>::type apply_tuple(F&& fun, Tuple<T...> const& tup)
typename get_result_type<F>::type apply_tuple(F&& fun, const Tuple<T...>& tup)
{
typedef typename get_result_type<F>::type result_type;
typedef typename get_arg_types<F>::types fun_args;
......@@ -113,7 +113,7 @@ typename get_result_type<F>::type apply_tuple(F&& fun, Tuple<T...> const& tup)
template<typename Result, size_t From, size_t To,
typename F, template<typename...> class Tuple, typename... T>
Result unchecked_apply_tuple_in_range(F&& fun, Tuple<T...> const& tup)
Result unchecked_apply_tuple_in_range(F&& fun, const Tuple<T...>& tup)
{
return apply_tuple_util<Result, false, From, To>
::apply(std::forward<F>(fun), tup);
......@@ -131,7 +131,7 @@ Result unchecked_apply_tuple_in_range(F&& fun, Tuple<T...>& tup)
// does not evaluate result type of functor
template<typename Result, typename F,
template<typename...> class Tuple, typename... T>
Result unchecked_apply_tuple(F&& fun, Tuple<T...> const& tup)
Result unchecked_apply_tuple(F&& fun, const Tuple<T...>& tup)
{
return apply_tuple_util<Result, false, 0, sizeof...(T) - 1>
::apply(std::forward<F>(fun), tup);
......
......@@ -46,62 +46,62 @@ template<class Subclass, class T = Subclass>
class comparable
{
friend bool operator==(Subclass const& lhs, T const& rhs)
friend bool operator==(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) == 0;
}
friend bool operator==(T const& lhs, Subclass const& rhs)
friend bool operator==(const T& lhs, const Subclass& rhs)
{
return rhs.compare(lhs) == 0;
}
friend bool operator!=(Subclass const& lhs, T const& rhs)
friend bool operator!=(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) != 0;
}
friend bool operator!=(T const& lhs, Subclass const& rhs)
friend bool operator!=(const T& lhs, const Subclass& rhs)
{
return rhs.compare(lhs) != 0;
}
friend bool operator<(Subclass const& lhs, T const& rhs)
friend bool operator<(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) < 0;
}
friend bool operator>(Subclass const& lhs, T const& rhs)
friend bool operator>(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) > 0;
}
friend bool operator<(T const& lhs, Subclass const& rhs)
friend bool operator<(const T& lhs, const Subclass& rhs)
{
return rhs > lhs;
}
friend bool operator>(T const& lhs, Subclass const& rhs)
friend bool operator>(const T& lhs, const Subclass& rhs)
{
return rhs < lhs;
}
friend bool operator<=(Subclass const& lhs, T const& rhs)
friend bool operator<=(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) <= 0;
}
friend bool operator>=(Subclass const& lhs, T const& rhs)
friend bool operator>=(const Subclass& lhs, const T& rhs)
{
return lhs.compare(rhs) >= 0;
}
friend bool operator<=(T const& lhs, Subclass const& rhs)
friend bool operator<=(const T& lhs, const Subclass& rhs)
{
return rhs >= lhs;
}
friend bool operator>=(T const& lhs, Subclass const& rhs)
friend bool operator>=(const T& lhs, const Subclass& rhs)
{
return rhs <= lhs;
}
......@@ -112,32 +112,32 @@ template<class Subclass>
class comparable<Subclass, Subclass>
{
friend bool operator==(Subclass const& lhs, Subclass const& rhs)
friend bool operator==(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) == 0;
}
friend bool operator!=(Subclass const& lhs, Subclass const& rhs)
friend bool operator!=(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) != 0;
}
friend bool operator<(Subclass const& lhs, Subclass const& rhs)
friend bool operator<(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) < 0;
}
friend bool operator<=(Subclass const& lhs, Subclass const& rhs)
friend bool operator<=(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) <= 0;
}
friend bool operator>(Subclass const& lhs, Subclass const& rhs)
friend bool operator>(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) > 0;
}
friend bool operator>=(Subclass const& lhs, Subclass const& rhs)
friend bool operator>=(const Subclass& lhs, const Subclass& rhs)
{
return lhs.compare(rhs) >= 0;
}
......
......@@ -40,7 +40,7 @@ namespace cppa { namespace detail {
template<size_t N, template<typename...> class Tuple, typename... Types>
const typename util::at<N, Types...>::type&
do_get(Tuple<Types...> const& t)
do_get(const Tuple<Types...>& t)
{
return ::cppa::get<N, Types...>(t);
}
......@@ -48,7 +48,7 @@ do_get(Tuple<Types...> const& t)
template<size_t N, typename LhsTuple, typename RhsTuple>
struct cmp_helper
{
inline static bool cmp(LhsTuple const& lhs, RhsTuple const& rhs)
inline static bool cmp(const LhsTuple& lhs, const RhsTuple& rhs)
{
return do_get<N>(lhs) == do_get<N>(rhs)
&& cmp_helper<N-1, LhsTuple, RhsTuple>::cmp(lhs, rhs);
......@@ -58,7 +58,7 @@ struct cmp_helper
template<typename LhsTuple, typename RhsTuple>
struct cmp_helper<0, LhsTuple, RhsTuple>
{
inline static bool cmp(LhsTuple const& lhs, RhsTuple const& rhs)
inline static bool cmp(const LhsTuple& lhs, const RhsTuple& rhs)
{
return do_get<0>(lhs) == do_get<0>(rhs);
}
......@@ -70,8 +70,8 @@ namespace cppa { namespace util {
template<template<typename...> class LhsTuple, typename... LhsTypes,
template<typename...> class RhsTuple, typename... RhsTypes>
bool compare_tuples(LhsTuple<LhsTypes...> const& lhs,
RhsTuple<RhsTypes...> const& rhs)
bool compare_tuples(const LhsTuple<LhsTypes...>& lhs,
const RhsTuple<RhsTypes...>& rhs)
{
static_assert(sizeof...(LhsTypes) == sizeof...(RhsTypes),
"could not compare tuples of different size");
......@@ -90,8 +90,8 @@ bool compare_tuples(LhsTuple<LhsTypes...> const& lhs,
template<template<typename...> class LhsTuple, typename... LhsTypes,
template<typename...> class RhsTuple, typename... RhsTypes>
bool compare_first_elements(LhsTuple<LhsTypes...> const& lhs,
RhsTuple<RhsTypes...> const& rhs)
bool compare_first_elements(const LhsTuple<LhsTypes...>& lhs,
const RhsTuple<RhsTypes...>& rhs)
{
typedef typename tl_zip<
util::type_list<LhsTypes...>,
......
......@@ -51,9 +51,9 @@ struct deduce_ref_type<T0&, T1>
};
template<typename T0, typename T1>
struct deduce_ref_type<T0 const&, T1>
struct deduce_ref_type<const T0&, T1>
{
typedef typename util::rm_ref<T1>::type const& type;
typedef const typename util::rm_ref<T1>::type& type;
};
} } // namespace cppa::util
......
......@@ -104,12 +104,12 @@ class duration
/**
* @relates duration
*/
bool operator==(duration const& lhs, duration const& rhs);
bool operator==(const duration& lhs, const duration& rhs);
/**
* @relates duration
*/
inline bool operator!=(duration const& lhs, duration const& rhs)
inline bool operator!=(const duration& lhs, const duration& rhs)
{
return !(lhs == rhs);
}
......@@ -122,7 +122,7 @@ inline bool operator!=(duration const& lhs, duration const& rhs)
template<class Clock, class Duration>
std::chrono::time_point<Clock, Duration>&
operator+=(std::chrono::time_point<Clock, Duration>& lhs,
cppa::util::duration const& rhs)
const cppa::util::duration& rhs)
{
switch (rhs.unit)
{
......
......@@ -65,7 +65,7 @@ class fixed_vector
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type& reference;
typedef value_type const& const_reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef value_type const* const_pointer;
......@@ -76,12 +76,12 @@ class fixed_vector
constexpr fixed_vector() : m_size(0) { }
fixed_vector(fixed_vector const& other) : m_size(other.m_size)
fixed_vector(const fixed_vector& other) : m_size(other.m_size)
{
std::copy(other.begin(), other.end(), begin());
}
fixed_vector& operator=(fixed_vector const& other)
fixed_vector& operator=(const fixed_vector& other)
{
resize(other.size());
std::copy(other.begin(), other.end(), begin());
......
......@@ -39,7 +39,7 @@ struct guard
virtual ~guard() { }
virtual bool operator()(T const&) const = 0;
virtual bool operator()(const T&) const = 0;
};
......
......@@ -43,7 +43,7 @@ struct is_mutable_ref
};
template<typename T>
struct is_mutable_ref<T const&>
struct is_mutable_ref<const T&>
{
static constexpr bool value = false;
};
......
......@@ -57,7 +57,7 @@ struct left_or_right<util::void_type&, Right>
};
template<typename Right>
struct left_or_right<util::void_type const&, Right>
struct left_or_right<const util::void_type&, Right>
{
typedef Right type;
};
......
......@@ -24,7 +24,7 @@ class producer_consumer_list
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type& reference;
typedef value_type const& const_reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef value_type const* const_pointer;
......
......@@ -76,7 +76,7 @@ namespace cppa { namespace util {
/**
* @brief Creates a hash from @p data using the RIPEMD-160 algorithm.
*/
void ripemd_160(std::array<std::uint8_t, 20>& storage, std::string const& data);
void ripemd_160(std::array<std::uint8_t, 20>& storage, const std::string& data);
} } // namespace cppa::util
......
......@@ -41,7 +41,7 @@ template<typename T>
struct rm_ref { typedef T type; };
template<typename T>
struct rm_ref<T const&> { typedef T type; };
struct rm_ref<const T&> { typedef T type; };
template<typename T>
struct rm_ref<T&> { typedef T type; };
......
......@@ -39,7 +39,7 @@ template<bool BeginLessEnd, size_t Begin, size_t End>
struct static_foreach_impl
{
template<typename Container, typename Fun, typename... Args>
static inline void _(Container const& c, Fun& f, Args&&... args)
static inline void _(const Container& c, Fun& f, Args&&... args)
{
f(get<Begin>(c), std::forward<Args>(args)...);
static_foreach_impl<(Begin+1 < End), Begin+1, End>
......@@ -58,19 +58,19 @@ struct static_foreach_impl
_ref(c, f, std::forward<Args>(args)...);
}
template<typename Container, typename Fun, typename... Args>
static inline void _auto(Container const& c, Fun& f, Args&&... args)
static inline void _auto(const Container& c, Fun& f, Args&&... args)
{
_(c, f, std::forward<Args>(args)...);
}
template<typename Container, typename Fun, typename... Args>
static inline bool eval(Container const& c, Fun& f, Args&&... args)
static inline bool eval(const Container& c, Fun& f, Args&&... args)
{
return f(get<Begin>(c), std::forward<Args>(args)...)
&& static_foreach_impl<(Begin+1 < End), Begin+1, End>
::eval(c, f, std::forward<Args>(args)...);
}
template<typename Container, typename Fun, typename... Args>
static inline bool eval_or(Container const& c, Fun& f, Args&&... args)
static inline bool eval_or(const Container& c, Fun& f, Args&&... args)
{
return f(get<Begin>(c), std::forward<Args>(args)...)
|| static_foreach_impl<(Begin+1 < End), Begin+1, End>
......
......@@ -43,7 +43,7 @@ namespace cppa {
// forward declarations
class uniform_type_info;
uniform_type_info const* uniform_typeid(std::type_info const&);
uniform_type_info const* uniform_typeid(const std::type_info&);
} // namespace cppa
......@@ -194,12 +194,12 @@ template<class ListA, class ListB,
template<typename, typename> class Fun = to_type_pair>
struct tl_zip_impl;
template<typename... LhsElements, typename... RhsElements,
template<typename... LhsElements,
typename... RhsElements,
template<typename, typename> class Fun>
struct tl_zip_impl<type_list<LhsElements...>, type_list<RhsElements...>, Fun>
{
static_assert(sizeof...(LhsElements) ==
sizeof...(RhsElements),
static_assert(sizeof...(LhsElements) == sizeof...(RhsElements),
"Lists have different size");
typedef type_list<typename Fun<LhsElements, RhsElements>::type...> type;
};
......
......@@ -42,15 +42,15 @@ struct void_type
typedef type_list<> tail;
constexpr void_type() { }
constexpr void_type(void_type const&) { }
void_type& operator=(void_type const&) = default;
constexpr void_type(const void_type&) { }
void_type& operator=(const void_type&) = default;
// anything could be used to initialize a void...
template<typename Arg0, typename... Args>
void_type(Arg0&&, Args&&...) { }
};
inline bool operator==(void_type const&, void_type const&) { return true; }
inline bool operator==(const void_type&, const void_type&) { return true; }
} } // namespace cppa::util
......
......@@ -118,7 +118,7 @@ int main(int, char**)
int i = 0;
receive_for(i, 2)
(
on<bar>() >> [](bar const& val)
on<bar>() >> [](const bar& val)
{
cout << "bar(foo("
<< val.f.a() << ","
......@@ -126,7 +126,7 @@ int main(int, char**)
<< val.i << ")"
<< endl;
},
on<baz>() >> [](baz const& val)
on<baz>() >> [](const baz& val)
{
// prints: baz ( foo ( 1, 2 ), bar ( foo ( 3, 4 ), 5 ) )
cout << to_string(val) << endl;
......
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