|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55775 - sandbox-branches/intrusive_fix_SunCC/libs/intrusive/test
From: C.Hite_at_[hidden]
Date: 2009-08-25 08:38:20
Author: chris_hite
Date: 2009-08-25 08:38:19 EDT (Tue, 25 Aug 2009)
New Revision: 55775
URL: http://svn.boost.org/trac/boost/changeset/55775
Log:
removed explicit from smart_ptr ctor
Text files modified:
sandbox-branches/intrusive_fix_SunCC/libs/intrusive/test/smart_ptr.hpp | 104 ++++++++++++++++++++--------------------
1 files changed, 52 insertions(+), 52 deletions(-)
Modified: sandbox-branches/intrusive_fix_SunCC/libs/intrusive/test/smart_ptr.hpp
==============================================================================
--- sandbox-branches/intrusive_fix_SunCC/libs/intrusive/test/smart_ptr.hpp (original)
+++ sandbox-branches/intrusive_fix_SunCC/libs/intrusive/test/smart_ptr.hpp 2009-08-25 08:38:19 EDT (Tue, 25 Aug 2009)
@@ -34,9 +34,9 @@
struct empty_type{};
template<class T>
-struct random_it
-: public boost::iterator<std::random_access_iterator_tag,
- T, std::ptrdiff_t, T*, T&>
+struct random_it
+: public boost::iterator<std::random_access_iterator_tag,
+ T, std::ptrdiff_t, T*, T&>
{
typedef const T* const_pointer;
typedef const T& const_reference;
@@ -108,25 +108,25 @@
public: //Public Functions
//!Constructor from raw pointer (allows "0" pointer conversion). Never throws.
- explicit smart_ptr(pointer ptr = 0)
+ smart_ptr(pointer ptr = 0)
: m_ptr(ptr)
{}
//!Constructor from other pointer. Never throws.
template <class T>
- smart_ptr(T *ptr)
+ smart_ptr(T *ptr)
: m_ptr(ptr)
{}
- //!Constructor from other smart_ptr
+ //!Constructor from other smart_ptr
smart_ptr(const smart_ptr& ptr)
: m_ptr(ptr.m_ptr)
{}
- //!Constructor from other smart_ptr. If pointers of pointee types are
+ //!Constructor from other smart_ptr. If pointers of pointee types are
//!convertible, offset_ptrs will be convertibles. Never throws.
template<class T2>
- smart_ptr(const smart_ptr<T2> &ptr)
+ smart_ptr(const smart_ptr<T2> &ptr)
: m_ptr(ptr.m_ptr)
{}
@@ -159,16 +159,16 @@
{ return m_ptr; }
//!Pointer-like -> operator. It can return 0 pointer. Never throws.
- pointer operator->() const
+ pointer operator->() const
{ return this->get(); }
- //!Dereferencing operator, if it is a null smart_ptr behavior
+ //!Dereferencing operator, if it is a null smart_ptr behavior
//! is undefined. Never throws.
- reference operator* () const
+ reference operator* () const
{ return *(this->get()); }
//!Indexing operator. Never throws.
- reference operator[](std::ptrdiff_t idx) const
+ reference operator[](std::ptrdiff_t idx) const
{ return this->get()[idx]; }
//!Assignment from pointer (saves extra conversion). Never throws.
@@ -179,18 +179,18 @@
smart_ptr& operator= (const smart_ptr & pt)
{ m_ptr = pt.m_ptr; return *this; }
- //!Assignment from related smart_ptr. If pointers of pointee types
+ //!Assignment from related smart_ptr. If pointers of pointee types
//! are assignable, offset_ptrs will be assignable. Never throws.
template <class T2>
smart_ptr& operator= (const smart_ptr<T2> & pt)
{ m_ptr = pt.m_ptr; return *this; }
-
+
//!smart_ptr + std::ptrdiff_t. Never throws.
- smart_ptr operator+ (std::ptrdiff_t offset) const
+ smart_ptr operator+ (std::ptrdiff_t offset) const
{ return smart_ptr(this->get()+offset); }
//!smart_ptr - std::ptrdiff_t. Never throws.
- smart_ptr operator- (std::ptrdiff_t offset) const
+ smart_ptr operator- (std::ptrdiff_t offset) const
{ return smart_ptr(this->get()-offset); }
//!smart_ptr += std::ptrdiff_t. Never throws.
@@ -202,7 +202,7 @@
{ m_ptr -= offset; return *this; }
//!++smart_ptr. Never throws.
- smart_ptr& operator++ (void)
+ smart_ptr& operator++ (void)
{ ++m_ptr; return *this; }
//!smart_ptr++. Never throws.
@@ -210,7 +210,7 @@
{ smart_ptr temp(*this); ++*this; return temp; }
//!--smart_ptr. Never throws.
- smart_ptr& operator-- (void)
+ smart_ptr& operator-- (void)
{ --m_ptr; return *this; }
//!smart_ptr--. Never throws.
@@ -218,16 +218,16 @@
{ smart_ptr temp(*this); --*this; return temp; }
//!safe bool conversion operator. Never throws.
- operator unspecified_bool_type() const
+ operator unspecified_bool_type() const
{ return this->get()? &self_t::unspecified_bool_type_func : 0; }
- //!Not operator. Not needed in theory, but improves portability.
+ //!Not operator. Not needed in theory, but improves portability.
//!Never throws.
bool operator! () const
{ return this->get() == 0; }
/*
friend void swap (smart_ptr &pt, smart_ptr &pt2)
- {
+ {
value_type *ptr = pt.get();
pt = pt2;
pt2 = ptr;
@@ -237,67 +237,67 @@
//!smart_ptr<T1> == smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator== (const smart_ptr<T1> &pt1,
+inline bool operator== (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() == pt2.get(); }
//!smart_ptr<T1> != smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator!= (const smart_ptr<T1> &pt1,
+inline bool operator!= (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() != pt2.get(); }
//!smart_ptr<T1> < smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator< (const smart_ptr<T1> &pt1,
+inline bool operator< (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() < pt2.get(); }
//!smart_ptr<T1> <= smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator<= (const smart_ptr<T1> &pt1,
+inline bool operator<= (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() <= pt2.get(); }
//!smart_ptr<T1> > smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator> (const smart_ptr<T1> &pt1,
+inline bool operator> (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() > pt2.get(); }
//!smart_ptr<T1> >= smart_ptr<T2>. Never throws.
template<class T1, class T2>
-inline bool operator>= (const smart_ptr<T1> &pt1,
+inline bool operator>= (const smart_ptr<T1> &pt1,
const smart_ptr<T2> &pt2)
{ return pt1.get() >= pt2.get(); }
-//!operator<<
-template<class E, class T, class Y>
-inline std::basic_ostream<E, T> & operator<<
+//!operator<<
+template<class E, class T, class Y>
+inline std::basic_ostream<E, T> & operator<<
(std::basic_ostream<E, T> & os, smart_ptr<Y> const & p)
{ return os << p.get(); }
-//!operator>>
-template<class E, class T, class Y>
-inline std::basic_istream<E, T> & operator>>
+//!operator>>
+template<class E, class T, class Y>
+inline std::basic_istream<E, T> & operator>>
(std::basic_istream<E, T> & os, smart_ptr<Y> & p)
{ Y * tmp; return os >> tmp; p = tmp; }
-//!std::ptrdiff_t + smart_ptr
+//!std::ptrdiff_t + smart_ptr
template<class T>
inline smart_ptr<T> operator+(std::ptrdiff_t diff, const smart_ptr<T>& right)
{ return right + diff; }
-//!smart_ptr - smart_ptr
+//!smart_ptr - smart_ptr
template<class T, class T2>
inline std::ptrdiff_t operator- (const smart_ptr<T> &pt, const smart_ptr<T2> &pt2)
{ return pt.get()- pt2.get(); }
-//!swap specialization
+//!swap specialization
template<class T>
-inline void swap (smart_ptr<T> &pt,
+inline void swap (smart_ptr<T> &pt,
smart_ptr<T> &pt2)
-{
+{
typename smart_ptr<T>::value_type *ptr = pt.get();
pt = pt2;
pt2 = ptr;
@@ -310,35 +310,35 @@
{ return p.get(); }
//!Simulation of static_cast between pointers. Never throws.
-template<class T, class U>
-inline smart_ptr<T>
+template<class T, class U>
+inline smart_ptr<T>
static_pointer_cast(smart_ptr<U> const & r)
-{
- return smart_ptr<T>(r, detail::static_cast_tag());
+{
+ return smart_ptr<T>(r, detail::static_cast_tag());
}
//!Simulation of const_cast between pointers. Never throws.
-template<class T, class U>
+template<class T, class U>
inline smart_ptr<T>const_pointer_cast(smart_ptr<U> const & r)
-{
- return smart_ptr<T>(r, detail::const_cast_tag());
+{
+ return smart_ptr<T>(r, detail::const_cast_tag());
}
//!Simulation of dynamic_cast between pointers. Never throws.
-template<class T, class U>
-inline smart_ptr<T>
+template<class T, class U>
+inline smart_ptr<T>
dynamic_pointer_cast(smart_ptr<U> const & r)
-{
+{
return smart_ptr<T>
- (r, detail::dynamic_cast_tag());
+ (r, detail::dynamic_cast_tag());
}
//!Simulation of reinterpret_cast between pointers. Never throws.
-template<class T, class U>
+template<class T, class U>
inline smart_ptr<T>
reinterpret_pointer_cast(smart_ptr<U> const & r)
-{
- return smart_ptr<T>(r, detail::reinterpret_cast_tag());
+{
+ return smart_ptr<T>(r, detail::reinterpret_cast_tag());
}
} //namespace intrusive {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk