123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef BOOST_STRING_UTIL_DETAIL_HPP
- #define BOOST_STRING_UTIL_DETAIL_HPP
- #include <boost/algorithm/string/config.hpp>
- #include <functional>
- #include <boost/range/iterator_range_core.hpp>
- namespace boost {
- namespace algorithm {
- namespace detail {
-
-
- template< typename CharT >
- struct empty_container
- {
- typedef empty_container<CharT> type;
- typedef CharT value_type;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef const value_type& reference;
- typedef const value_type& const_reference;
- typedef const value_type* iterator;
- typedef const value_type* const_iterator;
-
-
- const_iterator begin() const
- {
- return reinterpret_cast<const_iterator>(0);
- }
- const_iterator end() const
- {
- return reinterpret_cast<const_iterator>(0);
- }
- bool empty() const
- {
- return false;
- }
- size_type size() const
- {
- return 0;
- }
- };
-
-
- template<typename InputIteratorT, typename OutputIteratorT>
- inline OutputIteratorT bounded_copy(
- InputIteratorT First,
- InputIteratorT Last,
- OutputIteratorT DestFirst,
- OutputIteratorT DestLast )
- {
- InputIteratorT InputIt=First;
- OutputIteratorT OutputIt=DestFirst;
- for(; InputIt!=Last && OutputIt!=DestLast; InputIt++, OutputIt++ )
- {
- *OutputIt=*InputIt;
- }
- return OutputIt;
- }
-
- template<
- typename SeqT,
- typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator >
- struct copy_iterator_rangeF
- {
- typedef iterator_range<IteratorT> argument_type;
- typedef SeqT result_type;
- SeqT operator()( const iterator_range<IteratorT>& Range ) const
- {
- return copy_range<SeqT>(Range);
- }
- };
- }
- }
- }
- #endif
|