From b6d455a02bd338e9dc0faa09d4d8177ecd8d569a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 10 Apr 2016 15:53:05 +0200 Subject: NOISSUE reorganize and document libraries --- libraries/logic/TypeMagic.h | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 libraries/logic/TypeMagic.h (limited to 'libraries/logic/TypeMagic.h') diff --git a/libraries/logic/TypeMagic.h b/libraries/logic/TypeMagic.h deleted file mode 100644 index fa9d12a9..00000000 --- a/libraries/logic/TypeMagic.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -namespace TypeMagic -{ -/** "Cleans" the given type T by stripping references (&) and cv-qualifiers (const, volatile) from it - * const int => int - * QString & => QString - * const unsigned long long & => unsigned long long - * - * Usage: - * using Cleaned = Detail::CleanType; - * static_assert(std::is_same, "Cleaned == int"); - */ -// the order of remove_cv and remove_reference matters! -template -using CleanType = typename std::remove_cv::type>::type; - -/// For functors (structs with operator()), including lambdas, which in **most** cases are functors -/// "Calls" Function or Function -template struct Function : public Function {}; -/// For function pointers (&function), including static members (&Class::member) -template struct Function : public Function {}; -/// Default specialization used by others. -template struct Function -{ - using ReturnType = Ret; - using Argument = Arg; -}; -/// For member functions. Also used by the lambda overload if the lambda captures [this] -template struct Function : public Function {}; -template struct Function : public Function {}; -/// Overload for references -template struct Function : public Function {}; -/// Overload for rvalues -template struct Function : public Function {}; -// for more info: https://functionalcpp.wordpress.com/2013/08/05/function-traits/ -} -- cgit v1.2.3