type_traits (is_function): Minor consistency tweaks.
authorPaolo Carlini <pcarlini@suse.de>
Fri, 28 Jan 2005 21:00:19 +0000 (21:00 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 28 Jan 2005 21:00:19 +0000 (21:00 +0000)
2005-01-28  Paolo Carlini  <pcarlini@suse.de>

* include/tr1/type_traits (is_function): Minor consistency tweaks.

From-SVN: r94385

libstdc++-v3/ChangeLog
libstdc++-v3/include/tr1/type_traits

index e823fd872a18e89dd49cd637f8cf754338a0cd32..b41ead4d170f7e8fde783f2192465d337801f18e 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-28  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1/type_traits (is_function): Minor consistency tweaks.
+
 2005-01-28  Geoffrey Keating  <geoffk@apple.com>
 
        * testsuite/lib/libstdc++.exp (libstdc++_init): Search the path
index 753722941f9d224852569830a615a895658ed765..12609dd41b47e7b7c9f386d99e9dde80935300c5 100644 (file)
@@ -406,13 +406,22 @@ namespace tr1
     struct is_enum
     : public integral_constant<bool, __is_enum_helper<_Tp>::__value> { };
 
+  template<typename _Tp, bool = is_void<_Tp>::value>
+    struct __is_function_helper
+    {
+      static const bool __value = (__conv_helper<typename
+                                  add_reference<_Tp>::type, typename
+                                  add_pointer<_Tp>::type>::__value);
+    };
+
+  template<typename _Tp>
+    struct __is_function_helper<_Tp, true>
+    { static const bool __value = false; };
+
   template<typename _Tp>
     struct is_function
-    : public integral_constant<bool,
-                              (__conv_helper<typename add_reference<_Tp>::type,
-                               typename add_pointer<_Tp>::type>::__value)>
+    : public integral_constant<bool, __is_function_helper<_Tp>::__value>
     { };
-  _DEFINE_SPEC(0, is_function, void, false)
 
   /// @brief  composite type traits [4.5.2].
   template<typename _Tp>