#pragma once #include #include #ifdef _MSC_VER #pragma warning(disable: 4482) // nonstandard extension used enum Name::Val, standard in C++11 #define NO_RETURN __declspec(noreturn) #else #define NO_RETURN __attribute__((noreturn)) #endif //namespace std { // typedef decltype(sizeof(int)) size_t; // typedef decltype(nullptr) nullptr_t; //} namespace fc { using std::size_t; typedef decltype(nullptr) nullptr_t; template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template struct remove_reference { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce { typedef T type; }; template struct deduce{ typedef T type; }; template typename fc::remove_reference::type&& move( T&& t ) { return static_cast::type&&>(t); } template inline T&& forward( U&& u ) { return static_cast(u); } struct true_type { enum _value { value = 1 }; }; struct false_type { enum _value { value = 0 }; }; namespace detail { template fc::true_type is_class_helper(void(T::*)()); template fc::false_type is_class_helper(...); } template struct is_class { typedef decltype(detail::is_class_helper(0)) type; enum value_enum { value = type::value }; }; #ifdef min #undef min #endif template const T& min( const T& a, const T& b ) { return a < b ? a: b; } } // outside of namespace fc becuase of VC++ conflict with std::swap template void fc_swap( T& a, T& b ) { T tmp = fc::move(a); a = fc::move(b); b = fc::move(tmp); } #define LLCONST(constant) static_cast(constant##ll) #define ULLCONST(constant) static_cast(constant##ull)