Sha256: cd03242f12b18429d866cbee580c76c3dff46ae082e16c355056f7442090ff9f

Contents?: true

Size: 1.72 KB

Versions: 42

Compression:

Stored size: 1.72 KB

Contents

#ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED

// MS compatible compilers support #pragma once

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

//  detail/sp_convertible.hpp
//
//  Copyright 2008 Peter Dimov
//
//  Distributed under the Boost Software License, Version 1.0.
//  See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt

#include <boost/config.hpp>

#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE )
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif

#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 )
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif

#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x630 )
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif

#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )

namespace boost
{

namespace detail
{

template< class Y, class T > struct sp_convertible
{
    typedef char (&yes) [1];
    typedef char (&no)  [2];

    static yes f( T* );
    static no  f( ... );

    enum _vt { value = sizeof( (f)( static_cast<Y*>(0) ) ) == sizeof(yes) };
};

struct sp_empty
{
};

template< bool > struct sp_enable_if_convertible_impl;

template<> struct sp_enable_if_convertible_impl<true>
{
    typedef sp_empty type;
};

template<> struct sp_enable_if_convertible_impl<false>
{
};

template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_if_convertible_impl< sp_convertible< Y, T >::value >
{
};

} // namespace detail

} // namespace boost

#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE )

#endif  // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED

Version data entries

42 entries across 42 versions & 4 rubygems

Version Path
passenger-4.0.20 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.19 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.18 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.17 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.16 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.14 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.13 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.10 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.8 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.7 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.6 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.5 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-3.0.21 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.4 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.3 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.2 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.1 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.0.rc6 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-4.0.0.rc4 ext/boost/smart_ptr/detail/sp_convertible.hpp
passenger-3.9.2.beta ext/boost/smart_ptr/detail/sp_convertible.hpp