diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-04-10 04:29:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-04-30 23:59:23 +0200 |
commit | 47e37635f50c09b4f9a9ee7699e3120bab3e4088 (patch) | |
tree | 061c2f675fb7e244ebe4b54ef206bfbd615c91f8 /logic/TypeMagic.h | |
parent | fcd4a482f759cd58ee319a51082d0146b7e426e2 (diff) | |
download | MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.gz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.lz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.xz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.zip |
NOISSUE split GUI stuff from logic library
Diffstat (limited to 'logic/TypeMagic.h')
-rw-r--r-- | logic/TypeMagic.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/logic/TypeMagic.h b/logic/TypeMagic.h deleted file mode 100644 index fa9d12a9..00000000 --- a/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<const int>; - * static_assert(std::is_same<Cleaned, int>, "Cleaned == int"); - */ -// the order of remove_cv and remove_reference matters! -template <typename T> -using CleanType = typename std::remove_cv<typename std::remove_reference<T>::type>::type; - -/// For functors (structs with operator()), including lambdas, which in **most** cases are functors -/// "Calls" Function<Ret(*)(Arg)> or Function<Ret(C::*)(Arg)> -template <typename T> struct Function : public Function<decltype(&T::operator())> {}; -/// For function pointers (&function), including static members (&Class::member) -template <typename Ret, typename Arg> struct Function<Ret(*)(Arg)> : public Function<Ret(Arg)> {}; -/// Default specialization used by others. -template <typename Ret, typename Arg> struct Function<Ret(Arg)> -{ - using ReturnType = Ret; - using Argument = Arg; -}; -/// For member functions. Also used by the lambda overload if the lambda captures [this] -template <class C, typename Ret, typename Arg> struct Function<Ret(C::*)(Arg)> : public Function<Ret(Arg)> {}; -template <class C, typename Ret, typename Arg> struct Function<Ret(C::*)(Arg) const> : public Function<Ret(Arg)> {}; -/// Overload for references -template <typename F> struct Function<F&> : public Function<F> {}; -/// Overload for rvalues -template <typename F> struct Function<F&&> : public Function<F> {}; -// for more info: https://functionalcpp.wordpress.com/2013/08/05/function-traits/ -} |