mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #345 Extending CValueObjectStdTuple with policy classes to enable it to be used by classes which have different requirements.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
namespace BlackMisc
|
||||
{
|
||||
class CValueObject;
|
||||
template <class> class TupleConverter;
|
||||
|
||||
namespace Private
|
||||
{
|
||||
@@ -33,6 +34,17 @@ namespace BlackMisc
|
||||
// Inhibit doxygen warnings about missing documentation
|
||||
//! \cond PRIVATE
|
||||
|
||||
// To allow CValueObjectStdTuple policy classes to use the tuple system
|
||||
class EncapsulationBreaker
|
||||
{
|
||||
protected:
|
||||
template <class T>
|
||||
static auto toMetaTuple(T &o) -> decltype(TupleConverter<typename std::decay<T>::type>::toMetaTuple(o))
|
||||
{
|
||||
return TupleConverter<typename std::decay<T>::type>::toMetaTuple(o);
|
||||
}
|
||||
};
|
||||
|
||||
// Using SFINAE to help detect missing BLACK_ENABLE_TUPLE_CONVERSION macro in static_assert
|
||||
std::false_type hasEnabledTupleConversionHelper(...);
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user