Commit f1a515ff authored by neverlord's avatar neverlord

fixed reference_wrapper handling

parent 8c478912
...@@ -69,23 +69,36 @@ class value_guard ...@@ -69,23 +69,36 @@ class value_guard
typename tdata_from_type_list<FilteredPattern>::type m_args; typename tdata_from_type_list<FilteredPattern>::type m_args;
template<typename... Args> template<typename... Args>
inline bool _eval(util::void_type const&, tdata<> const&, Args&&...) const static inline bool _eval(util::void_type const&, tdata<> const&,
Args const&...)
{ {
return true; return true;
} }
template<class Tail, typename Arg0, typename... Args> template<class Tail, typename Arg0, typename... Args>
inline bool _eval(util::void_type const&, Tail const& tail, static inline bool _eval(util::void_type const&, Tail const& tail,
Arg0 const&, Args const&... args ) const Arg0 const&, Args const&... args )
{ {
return _eval(tail.head, tail.tail(), args...); return _eval(tail.head, tail.tail(), args...);
} }
template<typename T0, typename T1>
static inline bool cmp(T0 const& lhs, T1 const& rhs)
{
return lhs == rhs;
}
template<typename T0, typename T1>
static inline bool cmp(T0 const& lhs, std::reference_wrapper<T1> const& rhs)
{
return lhs == rhs.get();
}
template<typename Head, class Tail, typename Arg0, typename... Args> template<typename Head, class Tail, typename Arg0, typename... Args>
inline bool _eval(Head const& head, Tail const& tail, static inline bool _eval(Head const& head, Tail const& tail,
Arg0 const& arg0, Args const&... args) const Arg0 const& arg0, Args const&... args)
{ {
return head == arg0 && _eval(tail.head, tail.tail(), args...); return cmp(head, arg0) && _eval(tail.head, tail.tail(), args...);
} }
public: public:
......
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