refs #345 Extending CValueObjectStdTuple with policy classes to enable it to be used by classes which have different requirements.

This commit is contained in:
Mathew Sutcliffe
2014-11-10 20:28:30 +00:00
parent 40362e706a
commit 2b9d4098d4
5 changed files with 459 additions and 28 deletions

View File

@@ -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>