Add value printers for unique/shared_ptr

This commit is contained in:
Danilo Piparo 2019-04-28 15:58:45 +02:00 committed by SFT
parent ea23e15d42
commit 1df678fa0c

View File

@ -14,6 +14,7 @@
#error "This file must not be included by compiled programs."
#endif
#include <memory>
#include <string>
#include <tuple>
#include <type_traits>
@ -280,6 +281,21 @@ namespace cling {
return cling::printValue(V);
}
}
// unique_ptr<T>:
template <class T>
inline std::string printValue(std::unique_ptr<T> *val)
{
return "std::unique_ptr - " + printValue(val->get());
}
// shared_ptr<T>:
template <class T>
inline std::string printValue(std::shared_ptr<T> *val)
{
return "std::shared_ptr - " + printValue(val->get());
}
}
#endif