Commit 8d9c4afe authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'master' into unstable

parents 6a65f5d0 6c498131
......@@ -12,6 +12,13 @@ __2014_XX_XX__
* New header `system_messages.hpp` for message types used by the runtime
- Announce properly handles empty & POD types
Version 0.8.2
-------------
__2014-18-03__
- Fixed a compile-time error with some user-defined message types
Version 0.8.1
-------------
......
......@@ -35,6 +35,7 @@
#include <cstddef>
#include "cppa/util/type_traits.hpp"
#include "cppa/util/rebindable_reference.hpp"
namespace cppa {
......@@ -90,8 +91,9 @@ inline auto get_ref(std::tuple<Ts...>& tup) -> decltype(std::get<Pos>(tup)) {
* depending on the cv-qualifier of @p tup.
*/
template<size_t Pos, class Tuple>
inline auto get_cv_aware(Tuple& tup) -> decltype(get_ref<Pos>(tup)) {
return get_ref<Pos>(tup);
inline auto get_cv_aware(Tuple& tup)
-> decltype(util::unwrap_ref(get_ref<Pos>(tup))) {
return util::unwrap_ref(get_ref<Pos>(tup));
}
/**
......@@ -99,8 +101,9 @@ inline auto get_cv_aware(Tuple& tup) -> decltype(get_ref<Pos>(tup)) {
* depending on the cv-qualifier of @p tup.
*/
template<size_t Pos, class Tuple>
inline auto get_cv_aware(const Tuple& tup) -> decltype(get<Pos>(tup)) {
return get<Pos>(tup);
inline auto get_cv_aware(const Tuple& tup)
-> decltype(util::unwrap_ref(get<Pos>(tup))) {
return util::unwrap_ref(get<Pos>(tup));
}
} // namespace cppa
......
......@@ -114,6 +114,22 @@ class rebindable_reference {
};
template<typename T>
T& unwrap_ref(T& ref) {
return ref;
}
template<typename T>
T& unwrap_ref(util::rebindable_reference<T>& ref) {
return ref.get();
}
template<typename T>
typename std::add_const<T>::type&
unwrap_ref(const util::rebindable_reference<T>& ref) {
return ref.get();
}
} } // namespace cppa::util
#endif // CPPA_REBINDABLE_REFERENCE_HPP
No preview for this file type
......@@ -167,6 +167,13 @@ struct server : event_based_actor {
};
void compile_time_optional_variant_check(event_based_actor* self) {
typedef optional_variant<std::tuple<int, float>,
std::tuple<float, int, int>>
msg_type;
self->sync_send(self, atom("msg")).then([](msg_type) {});
}
void test_sync_send() {
scoped_actor self;
self->on_sync_failure([&] {
......
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