Index: library/bdm/shared_ptr.h
===================================================================
--- library/bdm/shared_ptr.h (revision 756)
+++ library/bdm/shared_ptr.h (revision 1064)
@@ -33,196 +33,196 @@
 template <typename T>
 class shared_ptr {
-	template<class U> friend class shared_ptr;
+    template<class U> friend class shared_ptr;
 
 private:
-	T *payload;
-	unsigned *refCnt;
+    T *payload;
+    unsigned *refCnt;
 
 public:
-	/*!
-	  \brief Default constructor
-
-	  Creates an empty shared_ptr - one that doesn't point anywhere.
-	*/
-	shared_ptr() :
-			payload ( 0 ),
-			refCnt ( 0 ) {
-	}
-
-	/*!
-	  Constructs a shared_ptr that owns the pointer p (unless p
-	  is NULL, in which case this constructor creates an empty
-	  shared_ptr). When p isn't null, it must have been alllocated
-	  by new!
-	*/
-	shared_ptr ( T *p ) :
-			payload ( p ),
-			refCnt ( p ? new unsigned ( 1 ) : 0 ) {
-	}
-
-	/*!
-	  \brief Copy constructor
-
-	  If other is empty, constructs an empty shared_ptr; otherwise,
-	  constructs a shared_ptr that shares ownership with other.
-	*/
-	shared_ptr ( const shared_ptr<T> &other ) :
-			payload ( other.payload ),
-			refCnt ( other.refCnt ) {
-		add_ref();
-	}
-
-	/*!
-	  \brief Generalized copy
-
-	  Allows initialization of shared pointer of a base type from
-	  raw pointer to a derived type.
-
-	  If other is empty, constructs an empty shared_ptr; otherwise,
-	  constructs a shared_ptr that shares ownership with other.
-	*/
-	template<typename U>
-	shared_ptr ( const shared_ptr<U> &other ) :
-			payload ( other.payload ),
-			refCnt ( other.refCnt ) {
-		add_ref();
-	}
-
-	/*!
-	  Destructor.
-	*/
-	~shared_ptr() {
-		del_ref();
-	}
-
-	/*!
-	  \brief Assignment operator
-	*/
-	shared_ptr<T> &operator= ( const shared_ptr<T> &other ) {
-		other.add_ref();
-		del_ref();
-
-		payload = other.payload;
-		refCnt = other.refCnt;
-
-		return *this;
-	}
-
-	/*!
-	  Returns the stored pointer (which remains owned by this
-	  instance). For empty instances, this method returns NULL.
-	*/
-	T *get() {
-		return payload;
-	}
-
-	/*!
-	  Dereferences the stored pointer (which remains owned by
-	  this instance). This method may only be called when the
-	  stored pointer isn't NULL.
-	*/
-	T *operator->() {
-		bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
-		return payload;
-	}
-
-	//! Returns a reference to the object pointed to by the stored
-	//! pointer. This method may only be called when the stored pointer
-	//! isn't NULL.
-	T &operator*() {
-		bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
-		return *payload;
-	}
-
-	/*!
-	  Returns the stored pointer (which remains owned by this
-	  instance). For empty instances, this method returns NULL.
-	*/
-	const T* get() const {
-		return payload;
-	}
-
-	//! Returns the stored pointer (which remains owned by this
-	//! instance). This method may only be called when the stored
-	//! pointer isn't NULL.
-	const T *operator->() const {
-		bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
-		return payload;
-	}
-
-	//! Returns a reference to the object pointed to by the stored
-	//! pointer. This method may only be called when the stored pointer
-	//! isn't NULL.
-	const T &operator*() const {
-		bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
-		return *payload;
-	}
-
-	//! Returns use_count() == 1
-	bool unique() const {
-		return refCnt && ( *refCnt == 1 );
-	}
-
-	/*!
-	  Returns the number of shared_ptr instances (including
-	  this instance) that share ownership with this instance. For
-	  empty instances, this method returns 0.
-	*/
-	long use_count() const {
-		return refCnt ? *refCnt : 0;
-	}
-
-	/*!
-	  \brief Boolean cast
-
-	  This operator returns true if and only if the instance isn't empty.
-	*/
-	operator bool() const {
-		return !!payload;
-	}
-
-	/*!
-	  \brief const cast
-
-	  Shared pointer to T can be converted to shared pointer to
-	  const T, just like T * can be converted to T const *.
-	*/
-	template<typename U>
-	operator shared_ptr<const U>() const {
-		shared_ptr<const U> cptr;
-		cptr.refCnt = refCnt;
-		cptr.payload = payload;
-		add_ref();
-		return cptr;
-	}
-
-	/*!
-	  \brief Efficient swap for shared_ptr.
-	 */
-	void swap ( shared_ptr &other ) {
-		std::swap ( payload, other.payload );
-		std::swap ( refCnt, other.refCnt );
-	}
+    /*!
+      \brief Default constructor
+
+      Creates an empty shared_ptr - one that doesn't point anywhere.
+    */
+    shared_ptr() :
+        payload ( 0 ),
+        refCnt ( 0 ) {
+    }
+
+    /*!
+      Constructs a shared_ptr that owns the pointer p (unless p
+      is NULL, in which case this constructor creates an empty
+      shared_ptr). When p isn't null, it must have been alllocated
+      by new!
+    */
+    shared_ptr ( T *p ) :
+        payload ( p ),
+        refCnt ( p ? new unsigned ( 1 ) : 0 ) {
+    }
+
+    /*!
+      \brief Copy constructor
+
+      If other is empty, constructs an empty shared_ptr; otherwise,
+      constructs a shared_ptr that shares ownership with other.
+    */
+    shared_ptr ( const shared_ptr<T> &other ) :
+        payload ( other.payload ),
+        refCnt ( other.refCnt ) {
+        add_ref();
+    }
+
+    /*!
+      \brief Generalized copy
+
+      Allows initialization of shared pointer of a base type from
+      raw pointer to a derived type.
+
+      If other is empty, constructs an empty shared_ptr; otherwise,
+      constructs a shared_ptr that shares ownership with other.
+    */
+    template<typename U>
+    shared_ptr ( const shared_ptr<U> &other ) :
+        payload ( other.payload ),
+        refCnt ( other.refCnt ) {
+        add_ref();
+    }
+
+    /*!
+      Destructor.
+    */
+    ~shared_ptr() {
+        del_ref();
+    }
+
+    /*!
+      \brief Assignment operator
+    */
+    shared_ptr<T> &operator= ( const shared_ptr<T> &other ) {
+        other.add_ref();
+        del_ref();
+
+        payload = other.payload;
+        refCnt = other.refCnt;
+
+        return *this;
+    }
+
+    /*!
+      Returns the stored pointer (which remains owned by this
+      instance). For empty instances, this method returns NULL.
+    */
+    T *get() {
+        return payload;
+    }
+
+    /*!
+      Dereferences the stored pointer (which remains owned by
+      this instance). This method may only be called when the
+      stored pointer isn't NULL.
+    */
+    T *operator->() {
+        bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
+        return payload;
+    }
+
+    //! Returns a reference to the object pointed to by the stored
+    //! pointer. This method may only be called when the stored pointer
+    //! isn't NULL.
+    T &operator*() {
+        bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
+        return *payload;
+    }
+
+    /*!
+      Returns the stored pointer (which remains owned by this
+      instance). For empty instances, this method returns NULL.
+    */
+    const T* get() const {
+        return payload;
+    }
+
+    //! Returns the stored pointer (which remains owned by this
+    //! instance). This method may only be called when the stored
+    //! pointer isn't NULL.
+    const T *operator->() const {
+        bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
+        return payload;
+    }
+
+    //! Returns a reference to the object pointed to by the stored
+    //! pointer. This method may only be called when the stored pointer
+    //! isn't NULL.
+    const T &operator*() const {
+        bdm_assert_debug ( payload, "dereferencing NULL shared pointer" );
+        return *payload;
+    }
+
+    //! Returns use_count() == 1
+    bool unique() const {
+        return refCnt && ( *refCnt == 1 );
+    }
+
+    /*!
+      Returns the number of shared_ptr instances (including
+      this instance) that share ownership with this instance. For
+      empty instances, this method returns 0.
+    */
+    long use_count() const {
+        return refCnt ? *refCnt : 0;
+    }
+
+    /*!
+      \brief Boolean cast
+
+      This operator returns true if and only if the instance isn't empty.
+    */
+    operator bool() const {
+        return !!payload;
+    }
+
+    /*!
+      \brief const cast
+
+      Shared pointer to T can be converted to shared pointer to
+      const T, just like T * can be converted to T const *.
+    */
+    template<typename U>
+    operator shared_ptr<const U>() const {
+        shared_ptr<const U> cptr;
+        cptr.refCnt = refCnt;
+        cptr.payload = payload;
+        add_ref();
+        return cptr;
+    }
+
+    /*!
+      \brief Efficient swap for shared_ptr.
+     */
+    void swap ( shared_ptr &other ) {
+        std::swap ( payload, other.payload );
+        std::swap ( refCnt, other.refCnt );
+    }
 
 private:
-	void add_ref() const {
-		if ( refCnt ) {
-			if ( *refCnt == UINT_MAX ) {
-				throw std::overflow_error (
-				    std::string ( "Shared pointer has too many references." ) );
-			}
-
-			++*refCnt;
-		}
-	}
-
-	void del_ref() {
-		if ( refCnt ) {
-			if ( ! ( --*refCnt ) ) {
-				delete payload;
-				delete refCnt;
-			}
-		}
-	}
+    void add_ref() const {
+        if ( refCnt ) {
+            if ( *refCnt == UINT_MAX ) {
+                throw std::overflow_error (
+                    std::string ( "Shared pointer has too many references." ) );
+            }
+
+            ++*refCnt;
+        }
+    }
+
+    void del_ref() {
+        if ( refCnt ) {
+            if ( ! ( --*refCnt ) ) {
+                delete payload;
+                delete refCnt;
+            }
+        }
+    }
 };
 
@@ -230,5 +230,5 @@
 template<typename T, typename U>
 bool operator== ( shared_ptr<T> const &a, shared_ptr<U> const &b ) {
-	return a.get() == b.get();
+    return a.get() == b.get();
 }
 
@@ -236,5 +236,5 @@
 template<typename T, typename U>
 bool operator!= ( shared_ptr<T> const &a, shared_ptr<U> const &b ) {
-	return a.get() != b.get();
+    return a.get() != b.get();
 }
 
@@ -242,5 +242,5 @@
 template<typename T, typename U>
 bool operator< ( shared_ptr<T> const &a, shared_ptr<U> const &b ) {
-	return a.get() < b.get();
+    return a.get() < b.get();
 }
 
@@ -255,35 +255,35 @@
 class object_ptr : public shared_ptr<T> {
 public:
-	/*!
-	  \brief Default constructor
-
-	  Calls T's default constructor.
-	*/
-	object_ptr() : shared_ptr<T> ( new T() ) { }
-
-	/*!
-	  \brief Upcast from shared_ptr<T> to object_ptr<T>
-
-	  \param b The shared pointer, which must not be empty.
-	*/
-	object_ptr ( const shared_ptr<T> &b ) : shared_ptr<T> ( b ) {
-		bdm_assert_debug ( this->get(), "object_ptr cannot be empty" );
-	}
-
-	/*!
-	  Constructs an object_ptr that owns the pointer p. p must
-	  have been alllocated by new!
-	*/
-	object_ptr ( T *p ) : shared_ptr<T> ( p ) {
-		bdm_assert_debug ( p, "object_ptr cannot be empty" );
-	}
-
-	/*!
-	  \brief Assignment operator
-	*/
-	object_ptr<T> &operator= ( const object_ptr<T> &other ) {
-		shared_ptr<T>::operator= ( other );
-		return *this;
-	}
+    /*!
+      \brief Default constructor
+
+      Calls T's default constructor.
+    */
+    object_ptr() : shared_ptr<T> ( new T() ) { }
+
+    /*!
+      \brief Upcast from shared_ptr<T> to object_ptr<T>
+
+      \param b The shared pointer, which must not be empty.
+    */
+    object_ptr ( const shared_ptr<T> &b ) : shared_ptr<T> ( b ) {
+        bdm_assert_debug ( this->get(), "object_ptr cannot be empty" );
+    }
+
+    /*!
+      Constructs an object_ptr that owns the pointer p. p must
+      have been alllocated by new!
+    */
+    object_ptr ( T *p ) : shared_ptr<T> ( p ) {
+        bdm_assert_debug ( p, "object_ptr cannot be empty" );
+    }
+
+    /*!
+      \brief Assignment operator
+    */
+    object_ptr<T> &operator= ( const object_ptr<T> &other ) {
+        shared_ptr<T>::operator= ( other );
+        return *this;
+    }
 };
 
