diff --git a/sol/traits.hpp b/sol/traits.hpp index 328eb4c7..57575cc2 100644 --- a/sol/traits.hpp +++ b/sol/traits.hpp @@ -26,29 +26,6 @@ #include namespace sol { -namespace detail { -template>::value> -struct is_function_impl : std::is_function::type> { }; - -template -struct is_function_impl { - using yes = char; - using no = struct { char s[ 2 ]; }; - - struct F { void operator()( ); }; - struct Derived : T, F { }; - template struct Check; - - template - static no test( Check* ); - - template - static yes test( ... ); - - static const bool value = sizeof( test( 0 ) ) == sizeof( yes ); -}; -} // detail - template using EnableIf = typename std::enable_if::type; @@ -78,6 +55,30 @@ struct multi_return<> : types<>{ template using Bool = std::integral_constant; + +namespace detail { +template>::value> +struct is_function_impl : std::is_function::type> { }; + +template +struct is_function_impl { + using yes = char; + using no = struct { char s[ 2 ]; }; + + struct F { void operator()( ); }; + struct Derived : T, F { }; + template struct Check; + + template + static no test( Check* ); + + template + static yes test( ... ); + + static const bool value = sizeof( test( 0 ) ) == sizeof( yes ); +}; +} // detail + template struct Function : Bool::value> { };