summaryrefslogtreecommitdiff
path: root/src/utf8_iterator.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-10-13 18:31:29 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-10-13 19:05:14 +0200
commitdfafcdb6e6b52ebdd5b664b7561e682c32762663 (patch)
treefd94329d686633260b7ec9dd4162287eb6225898 /src/utf8_iterator.hh
parent4f1ab5b74935d3250c41bbee5f347ec4f815063c (diff)
utf8::codepoint: configurable invalid byte policy
Diffstat (limited to 'src/utf8_iterator.hh')
-rw-r--r--src/utf8_iterator.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh
index e782e297..b3077dc8 100644
--- a/src/utf8_iterator.hh
+++ b/src/utf8_iterator.hh
@@ -11,7 +11,8 @@ namespace utf8
// adapter for an iterator on bytes which permits to iterate
// on unicode codepoints instead.
-template<typename Iterator>
+template<typename Iterator,
+ typename InvalidPolicy = InvalidBytePolicy::Throw>
class utf8_iterator
{
public:
@@ -125,7 +126,7 @@ private:
Codepoint get_value() const
{
if (m_value == -1)
- m_value = utf8::codepoint(m_it);
+ m_value = utf8::codepoint<InvalidPolicy>(m_it);
return m_value;
}