summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2016-03-03 10:17:07 +0100
committerMurray Cumming <murrayc@murrayc.com>2016-03-07 10:44:55 +0100
commitf4b2871e9178aaf7751d25e8684a833be5302372 (patch)
treefe0e6d9ca50d95ee683568ac54c33ab2d4cdceec /build
parent40b82d9883fcf3a4bb4dc0c28b2918af571123e7 (diff)
downloadsigc++-f4b2871e9178aaf7751d25e8684a833be5302372.tar.gz
Remove SIGC_WORKAROUND_OPERATOR_PARENTHESES, using just .template operator()<>.
We can add it back if we find that the Sun or Microsoft compilers still need it, when/if they support enough C++14 anyway. We can always use libsigc++-2.0 to easily discover what its configure checks say about the compiler behaviour.
Diffstat (limited to 'build')
-rw-r--r--build/cxx.m497
1 files changed, 14 insertions, 83 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