Skip to content

Commit 6431b02

Browse files
committed
fix: hide iterator under iter namespace to avoid collision
1 parent d01b18f commit 6431b02

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

src/Core/Primitive/QuadTreeDownIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace degate
2828
{
2929
template<typename T>
30-
class DownIterator : public iterator<std::forward_iterator_tag, T>
30+
class DownIterator : public iter::iterator<std::forward_iterator_tag, T>
3131
{
3232
private:
3333
QuadTree<T>* node;

src/Core/Primitive/QuadTreeRegionIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace degate
3535
class QuadTree;
3636

3737
template<typename T>
38-
class RegionIterator : public iterator<std::forward_iterator_tag, T>
38+
class RegionIterator : public iter::iterator<std::forward_iterator_tag, T>
3939
{
4040
private:
4141
QuadTree<T>* node;

src/Core/Utils/Iterator.h

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,37 @@
2626

2727
namespace degate
2828
{
29-
/**
30-
* @brief Common %iterator class.
31-
*
32-
* This class does nothing but define nested typedefs. %Iterator classes
33-
* can inherit from this class to save some work. The typedefs are then
34-
* used in specializations and overloading.
35-
*
36-
* In particular, there are no default implementations of requirements
37-
* such as @c operator++ and the like. (How could there be?)
38-
*/
39-
template<typename _Category,
40-
typename _Tp,
41-
typename _Distance = std::ptrdiff_t,
42-
typename _Pointer = _Tp*,
43-
typename _Reference = _Tp&>
44-
struct iterator
29+
namespace iter
4530
{
46-
/// One of the @link iterator_tags tag types@endlink.
47-
typedef _Category iterator_category;
48-
/// The type "pointed to" by the iterator.
49-
typedef _Tp value_type;
50-
/// Distance between iterators is represented as this type.
51-
typedef _Distance difference_type;
52-
/// This type represents a pointer-to-value_type.
53-
typedef _Pointer pointer;
54-
/// This type represents a reference-to-value_type.
55-
typedef _Reference reference;
56-
};
31+
/**
32+
* @brief Common %iterator class.
33+
*
34+
* This class does nothing but define nested typedefs. %Iterator classes
35+
* can inherit from this class to save some work. The typedefs are then
36+
* used in specializations and overloading.
37+
*
38+
* In particular, there are no default implementations of requirements
39+
* such as @c operator++ and the like. (How could there be?)
40+
*/
41+
template<typename _Category,
42+
typename _Tp,
43+
typename _Distance = std::ptrdiff_t,
44+
typename _Pointer = _Tp*,
45+
typename _Reference = _Tp&>
46+
struct iterator
47+
{
48+
/// One of the @link iterator_tags tag types@endlink.
49+
typedef _Category iterator_category;
50+
/// The type "pointed to" by the iterator.
51+
typedef _Tp value_type;
52+
/// Distance between iterators is represented as this type.
53+
typedef _Distance difference_type;
54+
/// This type represents a pointer-to-value_type.
55+
typedef _Pointer pointer;
56+
/// This type represents a reference-to-value_type.
57+
typedef _Reference reference;
58+
};
59+
} // namespace iter
5760
} // namespace degate
5861

5962
#endif

0 commit comments

Comments
 (0)