diff --git a/SDL2pp/Private/Utility.hh b/SDL2pp/Private/Utility.hh index 7ba47f0..67e6403 100644 --- a/SDL2pp/Private/Utility.hh +++ b/SDL2pp/Private/Utility.hh @@ -28,9 +28,9 @@ #include #endif +#include #include - namespace SDL2pp { /* * This is code not to be used directly by users of SDL2pp. @@ -93,6 +93,25 @@ namespace Private { template using And = typename AndOperation::type; #endif + +/* + * Templated class to an specific type in a tuple, returns std::true_type if the + * tuple contains T, std::false_type otherwise. + */ +template +struct TupleHasTypeOperation; + +template +struct TupleHasTypeOperation> : std::false_type { }; + +template +struct TupleHasTypeOperation> : TupleHasTypeOperation> { }; + +template +struct TupleHasTypeOperation> : std::true_type { }; + +template +using TupleHasType = typename TupleHasTypeOperation::type; } }