Skip to content

Commit 97980ec

Browse files
author
Daniel Kroening
committed
add begin() and end() to dstring container
1 parent f59fc6e commit 97980ec

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/solvers/smt2/smt2_format.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ std::ostream &smt2_format_rec(std::ostream &out, const exprt &expr)
5959
}
6060
else if(expr_type.id() == ID_string)
6161
{
62-
const auto &value_string = id2string(value);
63-
6462
out << '"';
6563

66-
for(const auto &c : value_string)
64+
for(const auto &c : value)
6765
{
6866
// " is the only escape sequence
6967
if(c == '"')

src/util/dstring.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ class dstringt final
151151
return no;
152152
}
153153

154+
// iterators for the underlying string
155+
std::string::const_iterator begin() const
156+
{
157+
return as_string().begin();
158+
}
159+
160+
std::string::const_iterator end() const
161+
{
162+
return as_string().end();
163+
}
164+
154165
private:
155166
#ifdef __GNUC__
156167
constexpr

0 commit comments

Comments
 (0)