Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
1c0a93cc
Commit
1c0a93cc
authored
Apr 28, 2014
by
Alexandre Duret-Lutz
Browse files
* src/graph/graph.hh (trans_iterator): Respect the forward_iterator API.
parent
ac98d7c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/graph.hh
View file @
1c0a93cc
...
...
@@ -25,6 +25,7 @@
#include <type_traits>
#include <tuple>
#include <cassert>
#include <iterator>
namespace
spot
{
...
...
@@ -172,13 +173,29 @@ namespace spot
// of that list.
template
<
typename
Graph
>
class
SPOT_API
trans_iterator
class
SPOT_API
trans_iterator
:
std
::
iterator
<
std
::
forward_iterator_tag
,
typename
std
::
conditional
<
std
::
is_const
<
Graph
>::
value
,
const
typename
Graph
::
trans_storage_t
,
typename
Graph
::
trans_storage_t
>::
type
>
{
typedef
std
::
iterator
<
std
::
forward_iterator_tag
,
typename
std
::
conditional
<
std
::
is_const
<
Graph
>::
value
,
const
typename
Graph
::
trans_storage_t
,
typename
Graph
::
trans_storage_t
>::
type
>
super
;
public:
typedef
typename
Graph
::
transition
transition
;
typedef
typename
Graph
::
trans_storage_t
trans_storage_t
;
trans_iterator
(
Graph
*
g
,
transition
t
)
:
t_
(
t
),
g_
(
g
)
trans_iterator
()
:
g_
(
nullptr
),
t_
(
0
)
{
}
trans_iterator
(
Graph
*
g
,
transition
t
)
:
g_
(
g
),
t_
(
t
)
{
}
...
...
@@ -192,9 +209,7 @@ namespace spot
return
t_
!=
o
.
t_
;
}
typename
std
::
conditional
<
std
::
is_const
<
Graph
>::
value
,
const
trans_storage_t
&
,
trans_storage_t
&>::
type
typename
super
::
reference
operator
*
()
{
return
g_
->
trans_storage
(
t_
);
...
...
@@ -214,8 +229,8 @@ namespace spot
}
protected:
transition
t_
;
Graph
*
g_
;
transition
t_
;
};
//////////////////////////////////////////////////
...
...
@@ -230,7 +245,7 @@ namespace spot
public:
typedef
typename
Graph
::
transition
transition
;
state_out
(
Graph
*
g
,
transition
t
)
:
t
_
(
t
),
g
_
(
g
)
g
_
(
g
),
t
_
(
t
)
{
}
...
...
@@ -241,7 +256,7 @@ namespace spot
trans_iterator
<
Graph
>
end
()
{
return
{
nullptr
,
0
};
return
{};
}
void
recycle
(
transition
t
)
...
...
@@ -250,8 +265,8 @@ namespace spot
}
protected:
transition
t_
;
Graph
*
g_
;
transition
t_
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment