forked from boostorg/smart_ptr
Remove headers moved into core.
This commit is contained in:
@@ -1,135 +0,0 @@
|
|||||||
#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
|
|
||||||
#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// detail/sp_typeinfo.hpp
|
|
||||||
//
|
|
||||||
// Copyright 2007 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_NO_TYPEID )
|
|
||||||
|
|
||||||
#include <boost/current_function.hpp>
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
class sp_typeinfo
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
sp_typeinfo( sp_typeinfo const& );
|
|
||||||
sp_typeinfo& operator=( sp_typeinfo const& );
|
|
||||||
|
|
||||||
char const * name_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit sp_typeinfo( char const * name ): name_( name )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==( sp_typeinfo const& rhs ) const
|
|
||||||
{
|
|
||||||
return this == &rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=( sp_typeinfo const& rhs ) const
|
|
||||||
{
|
|
||||||
return this != &rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool before( sp_typeinfo const& rhs ) const
|
|
||||||
{
|
|
||||||
return std::less< sp_typeinfo const* >()( this, &rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
char const* name() const
|
|
||||||
{
|
|
||||||
return name_;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct sp_typeid_
|
|
||||||
{
|
|
||||||
static sp_typeinfo ti_;
|
|
||||||
|
|
||||||
static char const * name()
|
|
||||||
{
|
|
||||||
return BOOST_CURRENT_FUNCTION;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#if defined(__SUNPRO_CC)
|
|
||||||
// see #4199, the Sun Studio compiler gets confused about static initialization
|
|
||||||
// constructor arguments. But an assignment works just fine.
|
|
||||||
template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
|
|
||||||
#else
|
|
||||||
template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct sp_typeid_< T volatile >: sp_typeid_< T >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <typeinfo>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
#if defined( BOOST_NO_STD_TYPEINFO )
|
|
||||||
|
|
||||||
typedef ::type_info sp_typeinfo;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef std::type_info sp_typeinfo;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#define BOOST_SP_TYPEID(T) typeid(T)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
|
|
@@ -1,48 +0,0 @@
|
|||||||
// Copyright Peter Dimov and David Abrahams 2002.
|
|
||||||
// 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)
|
|
||||||
#ifndef GET_POINTER_DWA20021219_HPP
|
|
||||||
#define GET_POINTER_DWA20021219_HPP
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
// In order to avoid circular dependencies with Boost.TR1
|
|
||||||
// we make sure that our include of <memory> doesn't try to
|
|
||||||
// pull in the TR1 headers: that's why we use this header
|
|
||||||
// rather than including <memory> directly:
|
|
||||||
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
// get_pointer(p) extracts a ->* capable pointer from p
|
|
||||||
|
|
||||||
template<class T> T * get_pointer(T * p)
|
|
||||||
{
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
|
|
||||||
|
|
||||||
template<class T> T * get_pointer(std::auto_ptr<T> const& p)
|
|
||||||
{
|
|
||||||
return p.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR )
|
|
||||||
|
|
||||||
template<class T> T * get_pointer( std::unique_ptr<T> const& p )
|
|
||||||
{
|
|
||||||
return p.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T> T * get_pointer( std::shared_ptr<T> const& p )
|
|
||||||
{
|
|
||||||
return p.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // GET_POINTER_DWA20021219_HPP
|
|
Reference in New Issue
Block a user