Skip to content
Snippets Groups Projects
Commit 3ca01553 authored by Danilo Piparo's avatar Danilo Piparo
Browse files

[VecOps] Fix ROOT-9669: value printing of RVec<T> where T does not have an operator<<

this has been resolved relying on value printing itself for the individual items.
parent 781eff6e
No related branches found
No related tags found
No related merge requests found
...@@ -1060,11 +1060,23 @@ TVEC_EXTERN_VDT_UNARY_FUNCTION(double, fast_atan) ...@@ -1060,11 +1060,23 @@ TVEC_EXTERN_VDT_UNARY_FUNCTION(double, fast_atan)
namespace cling { namespace cling {
template <typename T> template <typename T>
inline std::string printValue(ROOT::VecOps::RVec<T> *tvec) inline std::string printValue(ROOT::VecOps::RVec<T> *rvecp)
{ {
std::stringstream ss; std::stringstream os;
ss << *tvec;
return ss.str(); auto &rvec = *rvecp;
os << "{ ";
const auto size = rvec.size();
if (size) {
for (std::size_t i = 0; i < size - 1; ++i) {
os << printValue(&(rvec[i])) << ", ";
}
os << printValue(&(rvec[size - 1]));
}
os << " }";
return os.str();
} }
} // namespace cling } // namespace cling
......
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