From d1626e96ef6d3d6d1425432817dc94f23681752f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 29 Sep 2019 09:29:19 -0700 Subject: [PATCH] Remove unused overloads --- src/text/boost/text/grapheme_break.hpp | 156 ------------------------- 1 file changed, 156 deletions(-) diff --git a/src/text/boost/text/grapheme_break.hpp b/src/text/boost/text/grapheme_break.hpp index ebf4b14e..22c93684 100644 --- a/src/text/boost/text/grapheme_break.hpp +++ b/src/text/boost/text/grapheme_break.hpp @@ -4,8 +4,6 @@ #include #include -#include - #include #include @@ -158,123 +156,6 @@ constexpr std::array, 15> grapheme_breaks = {{ } } -#ifdef BOOST_TEXT_DOXYGEN - - /** Finds the nearest grapheme break at or before before `it`. If `it == - first`, that is returned. Otherwise, the first code point of the - grapheme that `it` is within is returned (even if `it` is already at - the first code point of a grapheme). - - This function only participates in overload resolution if `CPIter` - models the CPIter concept. */ - template - CPIter prev_grapheme_break(CPIter first, CPIter it, Sentinel last) noexcept; - - /** Finds the next word break after `first`. This will be the first code - point after the current word, or `last` if no next word exists. - - This function only participates in overload resolution if `CPIter` - models the CPIter concept. - - \pre `first` is at the beginning of a word. */ - template - CPIter next_grapheme_break(CPIter first, Sentinel last) noexcept; - - /** Finds the nearest grapheme break at or before before `it`. If `it == - range.begin()`, that is returned. Otherwise, the first code point of - the grapheme that `it` is within is returned (even if `it` is already - at the first code point of a grapheme). - - This function only participates in overload resolution if `CPRange` - models the CPRange concept. */ - template - detail::undefined prev_grapheme_break(CPRange & range, CPIter it) noexcept; - - /** Finds the next grapheme break after `it`. This will be the first code - point after the current grapheme, or `range.end()` if no next grapheme - exists. - - This function only participates in overload resolution if `CPRange` - models the CPRange concept. - - \pre `it` is at the beginning of a grapheme. */ - template - detail::undefined next_grapheme_break(CPRange & range, CPIter it) noexcept; - -#else - - template - auto prev_grapheme_break(CPIter first, CPIter it, Sentinel last) noexcept - -> detail::cp_iter_ret_t - { - if (it == first) - return it; - - if (it == last && --it == first) - return it; - - detail::grapheme_break_state state; - state.it = it; - state.prop = grapheme_prop(*state.it); - state.prev_prop = grapheme_prop(*std::prev(state.it)); - state.emoji_state = detail::grapheme_break_emoji_state_t::none; - - for (; state.it != first; state = prev(state)) { - state.prev_prop = grapheme_prop(*std::prev(state.it)); - - // When we see an RI, back up to the first RI so we can see what - // emoji state we're supposed to be in here. - if (state.emoji_state == - detail::grapheme_break_emoji_state_t::none && - state.prop == grapheme_property::Regional_Indicator) { - int ris_before = 0; - find_if_not_backward( - first, state.it, [&ris_before](uint32_t cp) { - bool const ri = grapheme_prop(cp) == - grapheme_property::Regional_Indicator; - if (ri) - ++ris_before; - return ri; - }); - state.emoji_state = - (ris_before % 2 == 0) - ? detail::grapheme_break_emoji_state_t::first_emoji - : detail::grapheme_break_emoji_state_t::second_emoji; - } - - // GB11 - if (state.prev_prop == grapheme_property::ZWJ && - state.prop == grapheme_property::ExtPict && - detail::gb11_prefix(first, std::prev(state.it))) { - continue; - } - - if (state.emoji_state == - detail::grapheme_break_emoji_state_t::first_emoji) { - if (state.prev_prop == grapheme_property::Regional_Indicator) { - state.emoji_state = - detail::grapheme_break_emoji_state_t::second_emoji; - return state.it; - } else { - state.emoji_state = - detail::grapheme_break_emoji_state_t::none; - } - } else if ( - state.emoji_state == - detail::grapheme_break_emoji_state_t::second_emoji && - state.prev_prop == grapheme_property::Regional_Indicator) { - state.emoji_state = - detail::grapheme_break_emoji_state_t::first_emoji; - continue; - } - - if (detail::table_grapheme_break(state.prev_prop, state.prop)) - return state.it; - } - - return first; - } - template auto next_grapheme_break(CPIter first, Sentinel last) noexcept -> detail::cp_iter_ret_t @@ -328,43 +209,6 @@ constexpr std::array, 15> grapheme_breaks = {{ return state.it; } - template - auto prev_grapheme_break(CPRange & range, CPIter it) noexcept - -> detail::cp_rng_alg_ret_t, CPRange> - { - return prev_grapheme_break(std::begin(range), it, std::end(range)); - } - - template - auto next_grapheme_break(CPRange & range, CPIter it) noexcept - -> detail::cp_rng_alg_ret_t, CPRange> - { - return next_grapheme_break(it, std::end(range)); - } - -#endif - - namespace detail { - template - struct next_grapheme_callable - { - CPIter operator()(CPIter it, Sentinel last) const noexcept - { - return next_grapheme_break(it, last); - } - }; - - template - struct prev_grapheme_callable - { - CPIter operator()(CPIter first, CPIter it, CPIter last) const - noexcept - { - return prev_grapheme_break(first, it, last); - } - }; - } - }} #endif