Fix diagnostic failure if an object return different types for begin() and end()
This commit is contained in:
parent
d73fdd2198
commit
7dc8c9aca9
@ -203,7 +203,8 @@ namespace cling {
|
||||
typename std::enable_if<
|
||||
std::is_reference<decltype(*std::begin(*obj))>::value>::type* = 0)
|
||||
-> decltype(std::end(*obj), std::string()) {
|
||||
auto iter = obj->begin(), iterEnd = obj->end();
|
||||
auto iter = obj->begin();
|
||||
auto iterEnd = obj->end();
|
||||
if (iter == iterEnd) return valuePrinterInternal::kEmptyCollection;
|
||||
|
||||
const void* M = TypeTest::isMap(obj);
|
||||
@ -224,7 +225,8 @@ namespace cling {
|
||||
typename std::enable_if<
|
||||
!std::is_reference<decltype(*(obj->begin()))>::value>::type* = 0)
|
||||
-> decltype(++(obj->begin()), obj->end(), std::string()) {
|
||||
auto iter = obj->begin(), iterEnd = obj->end();
|
||||
auto iter = obj->begin();
|
||||
auto iterEnd = obj->end();
|
||||
if (iter == iterEnd) return valuePrinterInternal::kEmptyCollection;
|
||||
|
||||
std::string str("{ ");
|
||||
|
Loading…
x
Reference in New Issue
Block a user