PROTON-1322: c++ Sunstudio: unable to find templated method
Sunstudio can't find templated method when parameter can be constructed by an
intermediate class (proton::scalar --> proton::value)
Signed-off-by: aboutros <adel.boutros@murex.com>
diff --git a/proton-c/bindings/cpp/include/proton/value.hpp b/proton-c/bindings/cpp/include/proton/value.hpp
index 242ec68..b24f02e 100644
--- a/proton-c/bindings/cpp/include/proton/value.hpp
+++ b/proton-c/bindings/cpp/include/proton/value.hpp
@@ -160,6 +160,9 @@
/// @related proton::value
template<class T> void get(const value& v, T& x) { codec::decoder d(v, true); d >> x; }
+/// @related proton::value
+template<class T, class U> inline void get(const U& u, T& x) { const value v(u); get(v, x); }
+
/// @copydoc scalar::coerce
/// @related proton::value
template<class T> T coerce(const value& v) { T x; coerce(v, x); return x; }