Skip to content
Snippets Groups Projects
Commit 38c3ecbe authored by Ke Liu's avatar Ke Liu
Browse files

Fix bug: empty_checker captures config by const&

parent 6d1858e4
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ namespace detail {
template <typename T, typename = void, typename = void>
struct empty_checker {
T const&& c;
T const& c;
bool empty() const&& {
return std::distance(std::begin(c), std::end(c)) == 0;
}
......@@ -44,7 +44,7 @@ namespace detail {
template <typename T, typename U>
struct empty_checker<T, void_t<typename std::enable_if<std::is_same<decltype(std::declval<T const&>().size()), size_t>::value>::type>, U> {
T const&& c;
T const& c;
bool empty() const&& {
return c.size() == 0;
}
......@@ -52,7 +52,7 @@ namespace detail {
template <typename T>
struct empty_checker<T, void_t<typename std::enable_if<std::is_same<decltype(std::declval<T const&>().empty()), bool>::value>::type>, void> {
T const&& c;
T const& c;
bool empty() const&& {
return c.empty();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment