Exemplo n.º 1
0
 void prepare( size_t nStart, size_t nEnd )
 {
     m_arr.reserve( nEnd - nStart );
     for ( size_t i = nStart; i < nEnd; ++i )
         m_arr.push_back( i );
     std::random_shuffle( m_arr.begin(), m_arr.end() );
 }
Exemplo n.º 2
0
            virtual void test()
            {
                m_nPushError = 0;

                for ( array_type::const_iterator it = m_arr.begin(); it != m_arr.end(); ++it ) {
                    if ( !m_Queue.push( SimpleValue( *it ) ))
                        ++m_nPushError;
                }
            }
	void insert_right(const char c) {
		auto insert_point = s.end() - 1;

		if( justify == Justify::Left ) {
			insert_point = std::find_if(s.begin(), s.end(), [](const char& a) {
				return a == ' ';
			});
		}

		if( *insert_point != ' ' ) {
			insert_point = shift_left();
		}

		*insert_point = c;
	}
	typename array_type::iterator shift_right() {
		return std::move_backward(s.begin(), s.end() - 1, s.end());
	}
	typename array_type::iterator shift_left() {
		return std::move(s.begin() + 1, s.end(), s.begin());
	}