Commit 13a37636 authored by neverlord's avatar neverlord

fixed pattern matching bug

parent 437c5bef
......@@ -23,6 +23,8 @@
#include "cppa/uniform_type_info.hpp"
#include "cppa/util/void_type.hpp"
#include "cppa/util/enable_if.hpp"
#include "cppa/util/disable_if.hpp"
#include "cppa/detail/demangle.hpp"
#include "cppa/detail/object_array.hpp"
......@@ -565,12 +567,20 @@ class uniform_type_info_map
}
template<typename T>
inline void insert(const std::set<std::string>& tnames)
inline void insert(const std::set<std::string>& tnames,
typename util::enable_if<std::is_integral<T>>::type* = 0)
{
//insert(new default_uniform_type_info_impl<T>(), tnames);
insert(new int_tinfo<T>, tnames);
}
template<typename T>
inline void insert(const std::set<std::string>& tnames,
typename util::disable_if<std::is_integral<T>>::type* = 0)
{
insert(new default_uniform_type_info_impl<T>(), tnames);
}
template<typename T>
inline void insert()
{
......
......@@ -60,14 +60,17 @@ size_t test__tuple()
tuple<int> t6;
// untyped tuples under test
any_tuple ut0 = t1;
tuple<int, long, double> t7;
CPPA_CHECK((match<int, long, double>(t7)));
// tuple views under test
auto tv0 = get_view<any_type*, float, any_type*, int, any_type>(t1);
auto tv1 = get_view<any_type*, int, any_type*>(tv0);
auto tv2 = get_view<int, any_type*, std::string>(t1);
auto tv3 = get_view<any_type*, int, std::string>(t1);
// any_tuple ut1 = tv0;
CPPA_CHECK(get<0>(t6) == 0);
CPPA_CHECK(get<0>(tv2) == get<0>(t1));
CPPA_CHECK(get<1>(tv2) == get<3>(t1));
......
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