[Boost-bugs] [Boost C++ Libraries] #1216: problems compiling template class using is_class and is_arithmetic

Subject: [Boost-bugs] [Boost C++ Libraries] #1216: problems compiling template class using is_class and is_arithmetic
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-08-27 00:12:16


#1216: problems compiling template class using is_class and is_arithmetic
------------------------------+---------------------------------------------
 Reporter: sheff | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Consider this code:

 {{{
 class C
 {
 public:
         template <typename T>
         typename boost::enable_if_c<boost::is_class<T>::value, void>::type
         f(T& t)
         {

         }

         template <typename T>
         typename boost::enable_if_c<boost::is_arithmetic<T>::value,
 void>::type
         f(T& t)
         {

         }
 };

 void main()
 {
         C c;
 }
 }}}

 it compiles without fault, but the following code:

 {{{
 class A {};

 template <class T1>
 class B : public T1
 {
 public:
         template <typename T2>
         typename boost::enable_if_c<boost::is_class<T2>::value,
 void>::type
         f(T2& t)
         {

         }

         template <typename T2>
         typename boost::enable_if_c<boost::is_arithmetic<T2>::value,
 void>::type
         f(T2& t)
         {

         }
 };

 void main()
 {
         B<A> a;
 }
 }}}

 fails to compile

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1216>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC