Skip to content
Snippets Groups Projects
Commit 2b71d7e9 authored by Markus Blatt's avatar Markus Blatt
Browse files

Fixed __unspecified_bool_type().

Forced initializing to zero.
Compiles with clang again.

[[Imported from SVN: r7049]]
parent 08167899
No related branches found
No related tags found
No related merge requests found
......@@ -209,16 +209,15 @@ namespace Dune
T *rep_;
// Needed for the implicit conversion to "bool"
typedef T* SharedCount::*__unspecified_bool_type;
typedef T* *__unspecified_bool_type;
public:
/** \brief Implicit conversion to "bool" */
operator __unspecified_bool_type() const // never throws
{
return rep_ == 0 ? 0 : &shared_ptr::SharedCount::rep_;
return rep_ == 0 ? 0 : &shared_ptr::rep_;
}
};
template<class T>
......@@ -232,7 +231,7 @@ namespace Dune
template<class T>
inline shared_ptr<T>::shared_ptr(nullptr_t n)
{
rep_ = n;
rep_ = 0;
count_ = new SharedCountImpl<DefaultDeleter>(rep_, DefaultDeleter());
count_->count_=0;
}
......@@ -248,7 +247,7 @@ namespace Dune
template<class T>
inline shared_ptr<T>::shared_ptr()
{
rep_ = nullptr;
rep_ = 0;
count_ = new SharedCountImpl<DefaultDeleter>(rep_, DefaultDeleter());
count_->count_=0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment