From 6f08efdc909aa16fa7ac16e255ebe51e00184e6e Mon Sep 17 00:00:00 2001 From: ntrifunovic Date: Thu, 23 Nov 2006 18:11:24 +0000 Subject: [PATCH] Added unchecked::previous to the 1.x branch git-svn-id: http://svn.code.sf.net/p/utfcpp/code@70 a809a056-fc17-0410-9590-b4f493f8b08e --- v1_0/source/utf8.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v1_0/source/utf8.h b/v1_0/source/utf8.h index 3bc1171..9d4f9af 100644 --- a/v1_0/source/utf8.h +++ b/v1_0/source/utf8.h @@ -484,13 +484,20 @@ namespace internal } template - uint32_t previous(octet_iterator& it) + uint32_t prior(octet_iterator& it) { while (internal::is_trail(*(--it))) ; octet_iterator temp = it; return next(temp); } + // Deprecated in versions that include prior, but only for the sake of consistency (see utf8::previous) + template + inline uint32_t previous(octet_iterator& it) + { + return prior(it); + } + template void advance (octet_iterator& it, distance_type n) {