epoc32/include/stdapis/boost/ptr_container/nullable.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/ptr_container/nullable.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,63 @@
     1.4 +//
     1.5 +// Boost.Pointer Container
     1.6 +//
     1.7 +//  Copyright Thorsten Ottosen 2003-2005. Use, modification and
     1.8 +//  distribution is subject to the Boost Software License, Version
     1.9 +//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.10 +//  http://www.boost.org/LICENSE_1_0.txt)
    1.11 +//
    1.12 +// For more information, see http://www.boost.org/libs/ptr_container/
    1.13 +//
    1.14 +
    1.15 +
    1.16 +#ifndef BOOST_INDIRECT_CONTAINER_NULLABLE_HPP
    1.17 +#define BOOST_INDIRECT_CONTAINER_NULLABLE_HPP
    1.18 +
    1.19 +#if defined(_MSC_VER) && (_MSC_VER >= 1200)
    1.20 +# pragma once
    1.21 +#endif
    1.22 +
    1.23 +#include <boost/type_traits/detail/yes_no_type.hpp>
    1.24 +#include <boost/mpl/eval_if.hpp>
    1.25 +#include <boost/mpl/identity.hpp>
    1.26 +#include <boost/config.hpp>
    1.27 +
    1.28 +namespace boost
    1.29 +{
    1.30 +    
    1.31 +    template< class T >
    1.32 +    struct nullable
    1.33 +    {
    1.34 +        typedef T type;
    1.35 +    };   
    1.36 +
    1.37 +    namespace ptr_container_detail
    1.38 +    {
    1.39 +        template< class T >
    1.40 +        type_traits::yes_type is_nullable( const nullable<T>* );
    1.41 +
    1.42 +        type_traits::no_type is_nullable( ... );        
    1.43 +    }
    1.44 +
    1.45 +    template< class T >
    1.46 +    struct is_nullable
    1.47 +    {
    1.48 +    private:
    1.49 +            BOOST_STATIC_CONSTANT( T*, var );
    1.50 +    public:
    1.51 +            BOOST_STATIC_CONSTANT(bool, value = sizeof( ptr_container_detail::is_nullable( var ) ) 
    1.52 +                                                == sizeof( type_traits::yes_type ) );
    1.53 +    };
    1.54 +    
    1.55 +    template< class T >
    1.56 +    struct remove_nullable
    1.57 +    {
    1.58 +        typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< is_nullable<T>,
    1.59 +                                                      T,
    1.60 +                                            mpl::identity<T> >::type
    1.61 +            type;
    1.62 +    };
    1.63 +
    1.64 +}
    1.65 +
    1.66 +#endif