From 3c654a7a9e23e9e9866c5721bc04321c6352dde1 Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 24 Jan 2022 08:35:34 -0500 Subject: [PATCH] cleanup formatting a little --- dlib/invoke.h | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/dlib/invoke.h b/dlib/invoke.h index f5792c11d..0cf7e190f 100644 --- a/dlib/invoke.h +++ b/dlib/invoke.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Davis E. King (davis@dlib.net) +// Copyright (C) 2021 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_INVOKE_Hh_ #define DLIB_INVOKE_Hh_ @@ -9,8 +9,9 @@ namespace dlib { - // ---------------------------------------------------------------------------------------- - namespace detail { +// ---------------------------------------------------------------------------------------- + namespace detail + { template< typename T > struct is_reference_wrapper : std::false_type {}; template< typename U > @@ -148,8 +149,10 @@ namespace dlib { return std::forward( f )( std::forward( args )...); } - } + } // end namespace detail +// ---------------------------------------------------------------------------------------- + template< typename F, typename... Args> constexpr auto invoke(F && f, Args &&... args) /*! @@ -163,7 +166,7 @@ namespace dlib return detail::INVOKE(std::forward( f ), std::forward( args )...); } - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- namespace detail { @@ -179,7 +182,9 @@ namespace dlib static constexpr bool value = true; using type = decltype( dlib::invoke(std::declval(), std::declval()...) ); }; - } + } // end namespace detail + +// ---------------------------------------------------------------------------------------- template< typename F, typename... Args > struct invoke_result : detail::invoke_traits< void, F, Args...> {}; @@ -197,7 +202,7 @@ namespace dlib - works with C++11 onwards !*/ - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- template< typename F, typename... Args > struct is_invocable : std::integral_constant::value> {}; @@ -207,7 +212,7 @@ namespace dlib - works with C++11 onwards !*/ - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- template struct is_invocable_r : std::integral_constant::value && @@ -218,7 +223,7 @@ namespace dlib - works with C++11 onwards !*/ - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- template< typename R, typename F, typename... Args> constexpr typename std::enable_if::value, R>::type @@ -233,7 +238,7 @@ namespace dlib return dlib::invoke(std::forward( f ), std::forward( args )...); } - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- namespace detail { @@ -247,7 +252,9 @@ namespace dlib return dlib::invoke(std::forward(fn), std::get(std::forward(tpl))...); } - } + } // end namespace detail + +// ---------------------------------------------------------------------------------------- template constexpr auto apply(F&& fn, Tuple&& tpl) @@ -268,7 +275,7 @@ namespace dlib make_index_sequence::type >::value>{}); } - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- namespace detail { @@ -277,7 +284,9 @@ namespace dlib { return T(std::get(std::forward(t))...); } - } + } // end namespace detail + +// ---------------------------------------------------------------------------------------- template constexpr T make_from_tuple( Tuple&& t ) @@ -291,7 +300,8 @@ namespace dlib make_index_sequence::type >::value>{}); } - // ---------------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------------- + } -#endif //DLIB_INVOKE_Hh_ \ No newline at end of file +#endif //DLIB_INVOKE_Hh_