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

RemoveConst --> remove_const

[[Imported from SVN: r4845]]
parent 5e998784
No related branches found
No related tags found
No related merge requests found
......@@ -67,8 +67,8 @@ namespace Dune {
class FieldIterator :
public Dune::RandomAccessIteratorFacade<FieldIterator<C,T>,T, T&, int>
{
friend class FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
friend class FieldIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
friend class FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
friend class FieldIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
public:
......@@ -86,12 +86,12 @@ namespace Dune {
: container_(&cont), position_(pos)
{}
FieldIterator(const FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >& other)
FieldIterator(const FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type >& other)
: container_(other.container_), position_(other.position_)
{}
#if 0
FieldIterator(const FieldIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >& other)
FieldIterator(const FieldIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >& other)
: container_(other.container_), position_(other.position_)
{}
#endif
......@@ -101,13 +101,13 @@ namespace Dune {
{}
#endif
// Methods needed by the forward iterator
bool equals(const FieldIterator<typename Dune::RemoveConst<C>::Type,typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const FieldIterator<typename remove_const<C>::type,typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
bool equals(const FieldIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const FieldIterator<const typename remove_const<C>::type,const typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
......@@ -134,13 +134,13 @@ namespace Dune {
position_=position_+n;
}
std::ptrdiff_t distanceTo(FieldIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(FieldIterator<const typename remove_const<C>::type,const typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
}
std::ptrdiff_t distanceTo(FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
......
......@@ -91,8 +91,8 @@ namespace Dune {
class GenericIterator :
public Dune::RandomAccessIteratorFacade<GenericIterator<C,T>,T, T&, D>
{
friend class GenericIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
friend class GenericIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
friend class GenericIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
friend class GenericIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
public:
......@@ -140,7 +140,7 @@ namespace Dune {
* 1. if we are mutable this is the only valid copy constructor, as the arguments is a mutable iterator
* 2. if we are a const iterator the argument is a mutable iterator => This is the needed conversion to initialize a const iterator form a mutable one.
*/
GenericIterator(const GenericIterator<typename Dune::RemoveConst<Container>::Type, typename Dune::RemoveConst<T>::Type >& other) : container_(other.container_), position_(other.position_)
GenericIterator(const GenericIterator<typename remove_const<Container>::type, typename remove_const<T>::type >& other) : container_(other.container_), position_(other.position_)
{}
/**
......@@ -152,17 +152,17 @@ namespace Dune {
* 1. if we are mutable the arguments is a const iterator and therefore calling this method is mistake in the users code and results in a (probably not understandable compiler error
* 2. If we are a const iterator this is the default copy constructor as the argument is a const iterator too.
*/
GenericIterator(const GenericIterator<const typename Dune::RemoveConst<Container>::Type, const typename Dune::RemoveConst<T>::Type >& other) : container_(other.container_), position_(other.position_)
GenericIterator(const GenericIterator<const typename remove_const<Container>::type, const typename remove_const<T>::type >& other) : container_(other.container_), position_(other.position_)
{}
// Methods needed by the forward iterator
bool equals(const GenericIterator<typename Dune::RemoveConst<Container>::Type,typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const GenericIterator<typename remove_const<Container>::type,typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
bool equals(const GenericIterator<const typename Dune::RemoveConst<Container>::Type,const typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const GenericIterator<const typename remove_const<Container>::type,const typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
......@@ -189,13 +189,13 @@ namespace Dune {
position_=position_+n;
}
std::ptrdiff_t distanceTo(GenericIterator<const typename Dune::RemoveConst<Container>::Type,const typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(GenericIterator<const typename remove_const<Container>::type,const typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
}
std::ptrdiff_t distanceTo(GenericIterator<typename Dune::RemoveConst<Container>::Type, typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(GenericIterator<typename remove_const<Container>::type, typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
......
......@@ -28,8 +28,8 @@ namespace Dune
template<class C, class T>
class TestIterator : public Dune::BidirectionalIteratorFacade<TestIterator<C,T>,T, T&, int>
{
friend class TestIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
friend class TestIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
friend class TestIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
friend class TestIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
public:
......@@ -41,23 +41,23 @@ namespace Dune
: container_(&cont), position_(pos)
{}
TestIterator(const TestIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >& other)
TestIterator(const TestIterator<typename remove_const<C>::type, typename remove_const<T>::type >& other)
: container_(other.container_), position_(other.position_)
{}
TestIterator(const TestIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >& other)
TestIterator(const TestIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >& other)
: container_(other.container_), position_(other.position_)
{}
// Methods needed by the forward iterator
bool equals(const TestIterator<typename Dune::RemoveConst<C>::Type,typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const TestIterator<typename remove_const<C>::type,typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
bool equals(const TestIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type>& other) const
bool equals(const TestIterator<const typename remove_const<C>::type,const typename remove_const<T>::type>& other) const
{
return position_ == other.position_ && container_ == other.container_;
}
......@@ -89,13 +89,13 @@ namespace Dune
position_=position_+n;
}
std::ptrdiff_t distanceTo(TestIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(TestIterator<const typename remove_const<C>::type,const typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
}
std::ptrdiff_t distanceTo(TestIterator<const typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type> other) const
std::ptrdiff_t distanceTo(TestIterator<const typename remove_const<C>::type, typename remove_const<T>::type> other) const
{
assert(other.container_==container_);
return other.position_ - position_;
......@@ -131,7 +131,7 @@ namespace Dune
template<class T, class V, class R = V&, class D = std::ptrdiff_t>
class ForwardIteratorFacade :
public std::iterator< std::forward_iterator_tag,
typename RemoveConst<V>::Type, // std::iterator needs mutable value type
typename remove_const<V>::type, // std::iterator needs mutable value type
D,
V*,
R>
......@@ -259,7 +259,7 @@ namespace Dune
template<class T, class V, class R = V&, class D = std::ptrdiff_t>
class BidirectionalIteratorFacade :
public std::iterator< std::bidirectional_iterator_tag,
typename RemoveConst<V>::Type, // std::iterator needs mutable value type
typename remove_const<V>::type, // std::iterator needs mutable value type
D,
V*,
R>
......@@ -407,7 +407,7 @@ namespace Dune
template<class T, class V, class R = V&, class D = std::ptrdiff_t>
class RandomAccessIteratorFacade :
public std::iterator< std::random_access_iterator_tag,
typename RemoveConst<V>::Type, // std::iterator needs mutable value type
typename remove_const<V>::type, // std::iterator needs mutable value type
D,
V*,
R>
......
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