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
98a883ae
Commit
98a883ae
authored
17 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
get ready for gcc-4.3 which has tuple in std:: instead of std::tr1::
[[Imported from SVN: r4958]]
parent
5a959db9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/tuples.hh
+36
-3
36 additions, 3 deletions
common/tuples.hh
with
36 additions
and
3 deletions
common/tuples.hh
+
36
−
3
View file @
98a883ae
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
#include
"typetraits.hh"
#include
"typetraits.hh"
#include
"helpertemplates.hh"
#include
"helpertemplates.hh"
#ifdef HAVE_TUPLE
#include
<tuple>
#endif
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TR1_TUPLE
#include
<tr1/tuple>
#include
<tr1/tuple>
#endif
#endif
...
@@ -55,7 +58,9 @@ namespace Dune {
...
@@ -55,7 +58,9 @@ namespace Dune {
typedef
T
&
ParameterType
;
typedef
T
&
ParameterType
;
};
};
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TUPLE
using
std
::
tuple
;
#elif defined HAVE_TR1_TUPLE
using
std
::
tr1
::
tuple
;
using
std
::
tr1
::
tuple
;
#else
#else
/**
/**
...
@@ -389,7 +394,9 @@ namespace Dune {
...
@@ -389,7 +394,9 @@ namespace Dune {
// be backwards compatible
// be backwards compatible
#define Tuple tuple
#define Tuple tuple
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TUPLE
using
std
::
tuple_element
;
#elif defined HAVE_TR1_TUPLE
using
std
::
tr1
::
tuple_element
;
using
std
::
tr1
::
tuple_element
;
#else
#else
/**
/**
...
@@ -434,7 +441,7 @@ namespace Dune {
...
@@ -434,7 +441,7 @@ namespace Dune {
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TR1_TUPLE
using
std
::
tr1
::
get
;
using
std
::
tr1
::
get
;
// for backwards compa
r
tibility
// for backwards compatibility
template
<
int
i
>
template
<
int
i
>
struct
Element
{
struct
Element
{
template
<
typename
T1
>
template
<
typename
T1
>
...
@@ -449,6 +456,24 @@ namespace Dune {
...
@@ -449,6 +456,24 @@ namespace Dune {
return
std
::
tr1
::
get
<
i
>
(
t
);
return
std
::
tr1
::
get
<
i
>
(
t
);
}
}
};
};
#elif defined HAVE_TUPLE
using
std
::
get
;
// for backwards compatibility
template
<
int
i
>
struct
Element
{
template
<
typename
T1
>
static
typename
TupleAccessTraits
<
typename
tuple_element
<
i
,
T1
>::
type
>::
NonConstType
get
(
T1
&
t
)
{
return
std
::
get
<
i
>
(
t
);
}
template
<
typename
T1
>
static
typename
TupleAccessTraits
<
typename
tuple_element
<
i
,
T1
>::
type
>::
ConstType
get
(
const
T1
&
t
)
{
return
std
::
get
<
i
>
(
t
);
}
};
#else
#else
/**
/**
* @brief Get the N-th element of a tuple.
* @brief Get the N-th element of a tuple.
...
@@ -527,6 +552,8 @@ namespace Dune {
...
@@ -527,6 +552,8 @@ namespace Dune {
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TR1_TUPLE
using
std
::
tr1
::
tuple_size
;
using
std
::
tr1
::
tuple_size
;
#elif defined HAVE_TUPLE
using
std
::
tuple_size
;
#else
#else
/**
/**
* @brief Template meta_programm to query the size of a tuple
* @brief Template meta_programm to query the size of a tuple
...
@@ -562,7 +589,13 @@ namespace Dune {
...
@@ -562,7 +589,13 @@ namespace Dune {
#ifdef HAVE_TR1_TUPLE
#ifdef HAVE_TR1_TUPLE
using
std
::
tr1
::
tie
;
using
std
::
tr1
::
tie
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
make_tuple
;
#endif
#ifdef HAVE_TUPLE
using
std
::
tie
;
using
std
::
make_tuple
;
#endif
#if defined HAVE_TUPLE || defined HAVE_TR1_TUPLE
template
<
int
i
>
template
<
int
i
>
struct
tuple_writer
struct
tuple_writer
{
{
...
...
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