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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Timo Koch
dune-common
Commits
4b5f95af
Commit
4b5f95af
authored
17 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
added AllocatorType traits class
[[Imported from SVN: r5031]]
parent
d4c6d0d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/typetraits.hh
+51
-0
51 additions, 0 deletions
common/typetraits.hh
doc/doxygen/Doxyfile
+1
-1
1 addition, 1 deletion
doc/doxygen/Doxyfile
with
52 additions
and
1 deletion
common/typetraits.hh
+
51
−
0
View file @
4b5f95af
...
...
@@ -355,6 +355,57 @@ namespace Dune
{
typedef
T2
Type
;
};
/**
* @brief provided one allocator, get the same allocator for a different object type
*
* the resulting type is exported as Type
*
* this class does not implement anything, it must be specialized
* for each allocator class in use
*/
template
<
class
A
,
class
T
>
struct
AllocatorType
;
/**
@copydoc AllocatorType
specialization for all allocators of the for ALLOCATOR<TYPE>
this is expected to work for
std::allocator
__gnu_cxx::new_allocator<T>
__gnu_cxx::malloc_allocator<T>
__gnu_cxx::__pool_alloc<T>
__gnu_cxx::__mt_alloc<T>
__gnu_cxx::bitmap_allocator<T>
__gnu_cxx::array_allocator<T>
__gnu_cxx::throw_allocator<T>
*/
template
<
template
<
class
>
class
Allocator
,
class
T1
,
class
T2
>
struct
AllocatorType
<
Allocator
<
T1
>
,
T2
>
{
typedef
Allocator
<
T2
>
Type
;
};
#ifdef _DEBUG_ALLOCATOR_H
/**
@copydoc AllocatorType
if you want to use this specialization, you have to ensure that
<ext/debug_allocator.h> is included before <dune/common/typetraits.hh>
specialization for __gnu_cxx::debug_allocator< Allocator >
*/
template
<
class
A
,
class
T
>
struct
AllocatorType
<
__gnu_cxx
::
debug_allocator
<
A
>
,
T
>
{
typedef
typename
__gnu_cxx
::
debug_allocator
<
typename
AllocatorType
<
A
,
T
>::
Type
>
Type
;
};
#endif
/** @} */
}
#endif
This diff is collapsed.
Click to expand it.
doc/doxygen/Doxyfile
+
1
−
1
View file @
4b5f95af
...
...
@@ -995,7 +995,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = DOXYGEN HAVE_MPI:=1
PREDEFINED = DOXYGEN HAVE_MPI:=1
_DEBUG_ALLOCATOR_H:=1
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
...
...
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