Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Leibner
dune-common
Commits
823c5ef8
Commit
823c5ef8
authored
9 years ago
by
Christoph Grüninger
Browse files
Options
Downloads
Patches
Plain Diff
[cleanup] Remove nullptr fallback and deprecate header.
Nothing needs to be included with proper C++11 compilers.
parent
4e69da9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/common/nullptr.hh
+1
-44
1 addition, 44 deletions
dune/common/nullptr.hh
dune/common/shared_ptr.hh
+0
-1
0 additions, 1 deletion
dune/common/shared_ptr.hh
dune/common/stdthread.hh
+0
-1
0 additions, 1 deletion
dune/common/stdthread.hh
with
1 addition
and
46 deletions
dune/common/nullptr.hh
+
1
−
44
View file @
823c5ef8
...
...
@@ -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
This diff is collapsed.
Click to expand it.
dune/common/shared_ptr.hh
+
0
−
1
View file @
823c5ef8
...
...
@@ -6,7 +6,6 @@
#include
<memory>
#include
<dune/common/nullptr.hh>
#include
<dune/common/typetraits.hh>
/**
* @file
...
...
This diff is collapsed.
Click to expand it.
dune/common/stdthread.hh
+
0
−
1
View file @
823c5ef8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment