mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 23:05:34 +08:00
refs #184 , moved template into global namespace, see https://dev.vatsim-germany.org/issues/184#note-2
This commit is contained in:
@@ -11,6 +11,24 @@
|
||||
#include <type_traits>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
/*!
|
||||
* 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 <class ENUM> typename std::enable_if<std::is_enum<ENUM>::value, QDBusArgument>::type const &
|
||||
operator>>(const QDBusArgument &argument, ENUM &enumType)
|
||||
{
|
||||
uint e;
|
||||
argument >> e;
|
||||
enumType = static_cast<ENUM>(e);
|
||||
return argument;
|
||||
}
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
// forward declaration
|
||||
@@ -297,22 +315,6 @@ namespace BlackMisc
|
||||
return argument >> static_cast<CValueObject &>(valueObject);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Non-member non-friend operator for streaming enums to QDBusArgument.
|
||||
*
|
||||
* \param argument
|
||||
* \param enumType
|
||||
* \return
|
||||
*/
|
||||
template <class ENUM> typename std::enable_if<std::is_enum<ENUM>::value, QDBusArgument>::type const &
|
||||
operator>>(const QDBusArgument &argument, ENUM &enumType)
|
||||
{
|
||||
uint e;
|
||||
argument>> e;
|
||||
enumType = static_cast<ENUM>(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
|
||||
|
||||
Reference in New Issue
Block a user