Skip to content

Commit

Permalink
Fix overload resolution for vector<bool>.
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel-Naumann committed Oct 13, 2016
1 parent b65aa9e commit f7c399e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,21 @@ namespace cling {
obj->begin()->first, obj->begin()->second,
std::string());

// Vector, set, deque etc. declaration
// Vector, set, deque etc. declaration.
template<typename CollectionType>
auto printValue_impl(const CollectionType *obj, int)
-> decltype(
++(obj->begin()), obj->end(),
*(obj->begin()),
std::string());
++(obj->begin()), obj->end(),
*(obj->begin()), &(*(obj->begin())),
std::string());

// As above, but without ability to take address of elements.
template<typename CollectionType>
auto printValue_impl(const CollectionType *obj, int, ...)
-> decltype(
++(obj->begin()), obj->end(),
*(obj->begin()),
std::string());

// No general fallback anymore here, void* overload used for that now
}
Expand Down Expand Up @@ -164,9 +172,9 @@ namespace cling {
return str + " }";
}

// Vector, set, deque etc.
// As above, but without ability to take address of elements.
template<typename CollectionType>
auto printValue_impl(const CollectionType *obj, int)
auto printValue_impl(const CollectionType *obj, int, ...)
-> decltype(
++(obj->begin()), obj->end(),
*(obj->begin()),
Expand Down

0 comments on commit f7c399e

Please sign in to comment.