diff --git a/STL_Extension/include/CGAL/result_of.h b/STL_Extension/include/CGAL/result_of.h index 87329e362b7..8f60a957e3c 100644 --- a/STL_Extension/include/CGAL/result_of.h +++ b/STL_Extension/include/CGAL/result_of.h @@ -22,55 +22,5 @@ #define CGAL_REPLACEMENT_HEADER "" #include -#include - -#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L - - // C++>=17 - -#elif CGAL_CXX11 - - #include - -#else // C++<11 - - // Address the warning C4003: not enough actual parameters for macro 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY' - // result_of.hpp includes files from boost/preprocessor - // This concerns boost 1_65_1 - #if defined(BOOST_MSVC) - #pragma warning(push) - #pragma warning(disable: 4003) - #endif - #include - #if defined(BOOST_MSVC) - #pragma warning(pop) - #endif - #include - -#endif // end C++<11 - -namespace CGAL { -namespace cpp11 { - -#if CGAL_CXX20 || __cpp_lib_is_invocable>=201703L - - template class result_of; - template - class result_of : public std::invoke_result { }; - -#elif CGAL_CXX11 - - using std::result_of; - -#else // C++<11 - - using boost::result_of; - -#endif // end C++<11 - -} // end cpp11 -} // end CGAL - -#include #endif // CGAL_RESULT_OF_H diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index eb1e6aa3270..5fb978b776d 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -50,6 +50,9 @@ #include #include +#include +#include +#include using namespace CGAL; struct item : public In_place_list_base { @@ -8217,6 +8220,27 @@ void test_make_sorted_pair() { std::pair >::value) ); } +void test_result_of() { + struct Result_functor + { + int operator()() + { + return 0; + } + + float operator()(const int&) + { + return 0.0f; + } + }; + + typedef CGAL::cpp11::result_of::type result_type; + typedef CGAL::cpp11::result_of::type result_type_float; + CGAL_static_assertion((boost::is_same::value)); + CGAL_static_assertion((boost::is_same::value)); + +} + int main() { init_global_data(); test_Circulator_identity(); @@ -8239,6 +8263,7 @@ int main() { test_prev_next(); test_copy_n(); test_make_sorted_pair(); + test_result_of(); return 0; } // EOF //