diff options
-rw-r--r-- | build/cxx.m4 | 97 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | sigc++/adaptors/adaptor_trait.h | 9 | ||||
-rw-r--r-- | sigc++/adaptors/bind.h | 4 | ||||
-rw-r--r-- | sigc++/adaptors/bind_return.h | 2 | ||||
-rw-r--r-- | sigc++/adaptors/exception_catch.h | 4 | ||||
-rw-r--r-- | sigc++/adaptors/hide.h | 2 | ||||
-rw-r--r-- | sigc++/adaptors/macros/retype.h.m4 | 2 | ||||
-rw-r--r-- | sigc++/adaptors/retype_return.h | 4 | ||||
-rw-r--r-- | sigc++/adaptors/track_obj.h | 2 | ||||
-rw-r--r-- | sigc++/functors/slot.h | 2 |
11 files changed, 26 insertions, 105 deletions
diff --git a/build/cxx.m4 b/build/cxx.m4 index d66d6d7..cd49255 100644 --- a/build/cxx.m4 +++ b/build/cxx.m4 @@ -1,95 +1,26 @@ -dnl -dnl SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD() -dnl -dnl -AC_DEFUN([SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[ -AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods.]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[ - #include <iostream> - - class Thing - { - public: - Thing() - {} - - template <class T> - void operator()(T a, T b) - { - T c = a + b; - std::cout << c << std::endl; - } - }; - - template<class T2> - class OtherThing - { - public: - void do_something() - { - Thing thing_; - thing_.template operator()<T2>(1, 2); - //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5: - } - }; -]], -[[ - OtherThing<int> thing; - thing.do_something(); -]])], -[ - sigcm_cxx_gcc_template_specialization_operator_overload=yes - AC_DEFINE([SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods.]) -],[ - sigcm_cxx_gcc_template_specialization_operator_overload=no -]) -AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload]) -]) - -AC_DEFUN([SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[ -AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods omitting the template keyword.]) +AC_DEFUN([SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION], [ +AC_MSG_CHECKING([if C++ compiler allows usage of member function in initialization of static member field.]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[ - #include <iostream> - - class Thing + struct test { - public: - Thing() - {} - - template <class T> - void operator()(T a, T b) - { - T c = a + b; - std::cout << c << std::endl; - } - }; + static char test_function(); - template<class T2> - class OtherThing - { - public: - void do_something() - { - Thing thing_; - thing_.operator()<T2>(1, 2); - //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5: - } + // Doesn't work with e.g. GCC 3.2. However, if test_function() + // is wrapped in a nested structure, it works just fine. + static const bool test_value + = (sizeof(test_function()) == sizeof(char)); }; ]], -[[ - OtherThing<int> thing; - thing.do_something(); -]])], +[[]])], [ - sigcm_cxx_msvc_template_specialization_operator_overload=yes - AC_DEFINE([SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods omitting the template keyword.]) + sigcm_cxx_self_reference_in_member_initialization=yes + AC_DEFINE([SIGC_SELF_REFERENCE_IN_MEMBER_INITIALIZATION],[1], + [does the C++ compiler allow usage of member function in initialization of static member field.]) ],[ - sigcm_cxx_msvc_template_specialization_operator_overload=no + sigcm_cxx_self_reference_in_member_initialization=no ]) -AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload]) +AC_MSG_RESULT([$sigcm_cxx_self_reference_in_member_initialization]) ]) dnl diff --git a/configure.ac b/configure.ac index 160ad02..a17029d 100644 --- a/configure.ac +++ b/configure.ac @@ -50,8 +50,7 @@ MM_ARG_ENABLE_DOCUMENTATION MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++]) AC_LANG([C++]) -SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD -SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD +SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION SIGC_CXX_PRAGMA_PUSH_POP_MACRO SIGC_CXX_HAS_SUN_REVERSE_ITERATOR diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h index aadf7e8..1b5d70b 100644 --- a/sigc++/adaptors/adaptor_trait.h +++ b/sigc++/adaptors/adaptor_trait.h @@ -33,15 +33,6 @@ namespace sigc { -// Call either operator()<>() or sun_forte_workaround<>(), -// depending on the compiler: -#ifdef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD - #define SIGC_WORKAROUND_OPERATOR_PARENTHESES template operator() -#else - #define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator() -#endif - - #ifndef DOXYGEN_SHOULD_SKIP_THIS template <class T_functor> struct adapts; #endif diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h index a4a624b..d82f993 100644 --- a/sigc++/adaptors/bind.h +++ b/sigc++/adaptors/bind.h @@ -177,7 +177,7 @@ private: call_functor_operator_parentheses(T&& tuple, std::index_sequence<Is...>) { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...); + return this->functor_.template operator()<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...); } }; @@ -235,7 +235,7 @@ private: call_functor_operator_parentheses(T&& tuple, std::index_sequence<Is...>) { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...); + return this->functor_.template operator()<typename std::tuple_element<Is, T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...); } }; diff --git a/sigc++/adaptors/bind_return.h b/sigc++/adaptors/bind_return.h index e6b129e..ff9525c 100644 --- a/sigc++/adaptors/bind_return.h +++ b/sigc++/adaptors/bind_return.h @@ -31,7 +31,7 @@ struct bind_return_functor : public adapts<T_functor> */ template <class... T_arg> inline typename unwrap_reference<T_return>::type operator()(T_arg... _A_a) - { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...> + { this->functor_.template operator()<type_trait_pass_t<T_arg>...> (_A_a...); return ret_value_.invoke(); } diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h index 1ea7c3b..03b74c4 100644 --- a/sigc++/adaptors/exception_catch.h +++ b/sigc++/adaptors/exception_catch.h @@ -76,7 +76,7 @@ struct exception_catch_functor : public adapts<T_functor> { try { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...> + return this->functor_.template operator()<type_trait_pass_t<T_arg>...> (_A_a...); } catch (...) @@ -105,7 +105,7 @@ struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_fun { try { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...> + return this->functor_.template operator()<type_trait_pass_t<T_arg>...> (_A_a...); } catch (...) diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h index 03056a6..8b9fc02 100644 --- a/sigc++/adaptors/hide.h +++ b/sigc++/adaptors/hide.h @@ -120,7 +120,7 @@ private: call_functor_operator_parentheses(T_tuple& tuple, std::index_sequence<Is...>) { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, T_tuple_specific>::type...>(std::get<Is>(tuple)...); + return this->functor_.template operator()<typename std::tuple_element<Is, T_tuple_specific>::type...>(std::get<Is>(tuple)...); } }; diff --git a/sigc++/adaptors/macros/retype.h.m4 b/sigc++/adaptors/macros/retype.h.m4 index 9970728..dd69839 100644 --- a/sigc++/adaptors/macros/retype.h.m4 +++ b/sigc++/adaptors/macros/retype.h.m4 @@ -111,7 +111,7 @@ struct retype_functor template <class... T_arg> decltype(auto) operator()(T_arg... _A_a) - { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_type>...> + { return this->functor_.template operator()<type_trait_take_t<T_type>...> (static_cast<T_type>(_A_a)...); } diff --git a/sigc++/adaptors/retype_return.h b/sigc++/adaptors/retype_return.h index e01a00a..29b8eb0 100644 --- a/sigc++/adaptors/retype_return.h +++ b/sigc++/adaptors/retype_return.h @@ -23,7 +23,7 @@ struct retype_return_functor : public adapts<T_functor> template <class... T_arg> inline T_return operator()(T_arg&&... _A_a) - { return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...> + { return T_return(this->functor_.template operator()<T_arg...> (std::forward<T_arg>(_A_a)...)); } @@ -60,7 +60,7 @@ struct retype_return_functor<void, T_functor> : public adapts<T_functor> template <class... T_arg> inline void operator()(T_arg... _A_a) - { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...> + { this->functor_.template operator()<T_arg...> (_A_a...); } diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h index 61830fc..43ae600 100644 --- a/sigc++/adaptors/track_obj.h +++ b/sigc++/adaptors/track_obj.h @@ -76,7 +76,7 @@ public: decltype(auto) operator()(T_arg&&... _A_arg) { - return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...> + return this->functor_.template operator()<type_trait_pass_t<T_arg>...> (std::forward<T_arg>(_A_arg)...); } diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h index ea07944..66ad68e 100644 --- a/sigc++/functors/slot.h +++ b/sigc++/functors/slot.h @@ -113,7 +113,7 @@ struct slot_call { typedef typed_slot_rep<T_functor> typed_slot; typed_slot *typed_rep = static_cast<typed_slot*>(rep); - return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_arg>...> + return (typed_rep->functor_).template operator()<type_trait_take_t<T_arg>...> (a_...); } |