36 template <
typename StringType>
39 template <
typename StreamType,
45 typedef typename std::iterator_traits<StreamType>::value_type
type;
47 static const uint32 SYMBOLS_PER_WORD = (
sizeof(
type)*8)/SYMBOL_SIZE_T;
48 static const uint32 WORDS = 512 / SYMBOLS_PER_WORD;
51 template <
typename StreamType,
62 const StreamType in_stream =
string.begin().stream();
63 const uint32 in_offset =
string.begin().index();
64 const uint32 N =
string.length();
66 typedef typename std::iterator_traits<StreamType>::value_type word_type;
68 const uint32 SYMBOLS_PER_WORD = (
sizeof(word_type)*8) / SYMBOL_SIZE_T;
69 uint32 word_offset = in_offset & (SYMBOLS_PER_WORD-1);
70 uint32 begin_word = in_offset / SYMBOLS_PER_WORD;
71 uint32 end_word = (in_offset + N + SYMBOLS_PER_WORD-1) / SYMBOLS_PER_WORD;
73 for (
uint32 word = begin_word; word < end_word; ++word)
74 lmem[word - begin_word] = in_stream[ word ];
77 const_stream_type clmem_stream( lmem );