Skip to content
Snippets Groups Projects
Commit 823c5ef8 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[cleanup] Remove nullptr fallback and deprecate header.

Nothing needs to be included with proper C++11 compilers.
parent 4e69da9a
No related branches found
No related tags found
No related merge requests found
......@@ -3,55 +3,12 @@
#ifndef DUNE_NULLPTR_HH
#define DUNE_NULLPTR_HH
/** \file
* \brief Fallback implementation of the nullptr object in C++0x
*/
#if ! HAVE_NULLPTR
/**
\brief Fallback implementation of nullptr
see C++ proposal
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
*/
const // this is a const object...
class dune_nullptr_t { // of type nullptr_t
public:
template<class T> // convertible to any type
operator T*() const // of null non-member
{ return 0; } // pointer...
template<class C, class T> // or any type of null
operator T C::*() const // member pointer...
{ return 0; }
private:
void operator&() const; // whose address can't be taken
} nullptr = {}; // and whose name is nullptr
namespace Dune {
typedef dune_nullptr_t nullptr_t;
}
template<class T>
bool operator == (T* t, dune_nullptr_t)
{
return (t == static_cast<T*>(nullptr));
}
template<class T>
bool operator == (dune_nullptr_t, T* t)
{
return (t == static_cast<T*>(nullptr));
}
#else
#include <cstddef>
namespace Dune {
using std::nullptr_t;
}
#endif // HAVE_NULLPTR
#warning The header dune/common/nullptr.hh is deprecated. Just remove the include.
#endif // DUNE_NULLPTR_HH
......@@ -6,7 +6,6 @@
#include <memory>
#include <dune/common/nullptr.hh>
#include <dune/common/typetraits.hh>
/**
* @file
......
......@@ -4,7 +4,6 @@
#ifndef DUNE_COMMON_STDTHREAD_HH
#define DUNE_COMMON_STDTHREAD_HH
#include <dune/common/nullptr.hh>
#include <dune/common/unused.hh>
namespace Dune
......
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