Boost logo

Boost :

From: Gennadiy E. Rozental (rogeeff_at_[hidden])
Date: 2001-09-07 10:46:57


Hi,

I propose following change in select_type.hpp to be able to
compile it with Solaris Forte C++ 6 u.1

Gennadiy.

cvs diff select_type.hpp
Index: select_type.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/detail/select_type.hpp,v
retrieving revision 1.4
diff -r1.4 select_type.hpp
19,24c19,28
< // Template class if_true -- select among 2 types based on a bool
constant expression
< // Usage:
< // typename if_true<(bool_const_expression)>::template
then<true_type, false_type>::type
<
< // HP aCC cannot deal with missing names for template value
parameters
< template <bool b> struct if_true

---
>   struct select_then 
>   {       
>     template<class Then, class Else>
>     struct result
>     {
>       typedef Then type;
>     };
>   }; // end select_then
>   
>   struct select_else
26,31c30,38
<       template <class T, class F>
<       struct then { typedef T type; };
<   };
< 
<   template <>
<   struct if_true<false>
---
>     template<class Then, class Else>
>     struct result
>     {
>       typedef Else type;
>     };
>   }; // end select_else
>   
>   template<bool Condition>
>   struct selector
33,35c40,55
<       template <class T, class F>
<       struct then { typedef F type; };
<   };
---
>     typedef select_then type;
>   }; // end selector
>   
>   template<>
>   struct selector<false>
>   {
>     typedef select_else type;
>   }; // end selector<false>
>   
>   template<bool Condition, class Then, class Else>
>   struct if_true
>   {
>     typedef selector<Condition>::type       select;
>     typedef select::result<Then,Else>::type type;
>   }; // if_true
>   

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk