Commit 034620c5 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

graph: fix internal iterator constness

* spot/graph/graph.hh: Use only const variants of begin()/end(), since
they do not modify the iterator.
parent 5841af02
......@@ -277,24 +277,12 @@ namespace spot
}
typename super::reference
operator*()
{
return g_->edge_storage(t_);
}
const typename super::reference
operator*() const
{
return g_->edge_storage(t_);
}
typename super::pointer
operator->()
{
return &g_->edge_storage(t_);
}
const typename super::pointer
operator->() const
{
return &g_->edge_storage(t_);
......@@ -407,12 +395,12 @@ namespace spot
{
}
edge_iterator<Graph> begin()
edge_iterator<Graph> begin() const
{
return {g_, t_};
}
edge_iterator<Graph> end()
edge_iterator<Graph> end() const
{
return {};
}
......@@ -499,23 +487,11 @@ namespace spot
}
typename super::reference
operator*()
{
return tv_[t_];
}
const typename super::reference
operator*() const
{
return tv_[t_];
}
const typename super::pointer
operator->()
{
return &tv_[t_];
}
typename super::pointer
operator->() const
{
......@@ -542,12 +518,12 @@ namespace spot
{
}
iter_t begin()
iter_t begin() const
{
return {0, tv_};
}
iter_t end()
iter_t end() const
{
return {tv_};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment