From a38385e6e6c575534663413cfedddce127eade4c Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 14 Mar 2014 01:50:33 +0100 Subject: [PATCH] refs #184 , moved template into global namespace, see https://dev.vatsim-germany.org/issues/184#note-2 --- src/blackmisc/valueobject.h | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/blackmisc/valueobject.h b/src/blackmisc/valueobject.h index dac085bf2..6acf2399e 100644 --- a/src/blackmisc/valueobject.h +++ b/src/blackmisc/valueobject.h @@ -11,6 +11,24 @@ #include #include + +/*! + * Non-member non-friend operator for streaming enums to QDBusArgument. + * + * \param argument + * \param enumType + * \return + * \remarks Currently outside namespace for OSX build, see https://dev.vatsim-germany.org/issues/184 + */ +template typename std::enable_if::value, QDBusArgument>::type const & +operator>>(const QDBusArgument &argument, ENUM &enumType) +{ + uint e; + argument >> e; + enumType = static_cast(e); + return argument; +} + namespace BlackMisc { // forward declaration @@ -297,22 +315,6 @@ namespace BlackMisc return argument >> static_cast(valueObject); } - /*! - * Non-member non-friend operator for streaming enums to QDBusArgument. - * - * \param argument - * \param enumType - * \return - */ - template typename std::enable_if::value, QDBusArgument>::type const & - operator>>(const QDBusArgument &argument, ENUM &enumType) - { - uint e; - argument>> e; - enumType = static_cast(e); - return argument; - } - /*! * Non-member non-friend operator for streaming T objects from QDBusArgument. * Needed because we can't rely on the friend operator in some cases due to