Skip to content
Snippets Groups Projects
Commit d9c87cb9 authored by Oliver Sander's avatar Oliver Sander
Browse files

the method index now returns an lvalue

[[Imported from SVN: r1781]]
parent 48ad8e5f
No related branches found
No related tags found
No related merge requests found
......@@ -233,17 +233,27 @@ namespace Dune {
}
//! Gets the index of a UG element
static int index(const typename TargetType<0,dim>::T* theElement) {
static int& index(typename TargetType<0,dim>::T* theElement) {
return theElement->ge.id;
}
//! Gets the index of a UG element
static const int& index(const typename TargetType<0,dim>::T* theElement) {
return theElement->ge.id;
}
//! Gets the index of a UG node
static int& index(typename TargetType<dim,dim>::T* theNode) {
return theNode->id;
}
//! Gets the index of a UG node
static int index(const typename TargetType<dim,dim>::T* theNode) {
static const int& index(const typename TargetType<dim,dim>::T* theNode) {
return theNode->id;
}
//! Calm the compiler
static int index(const void* theWhatever) {
static int& index(const void* theWhatever) {
DUNE_THROW(NotImplemented, "No index available for this kind of object");
return 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