Ejemplo n.º 1
0
int main(int argc, char* argv[])
{
    v_circular_buffer_2.push_back(1);
    v_circular_buffer_2.push_back(4);

    MyClass tmp(x);
    v_intrusive_set_2.insert(tmp);

    MyClass_list tmp_list(x);
    v_intrusive_list_2.push_front(tmp_list);

    int r = done();  // break here
    r += argc + (char)argv[0][0];
    return r % 2;
}
Ejemplo n.º 2
0
	boost::regex const & get_regex(const char * str, size_t size)
	{
		re_set_t::iterator re_in_cache = re_set.find(str, regex_hash(), regex_equal());
		if (re_in_cache != re_set.end()) {
			regex_node & node = *re_in_cache;
			bin::list<regex_node>::iterator re_in_list = bin::list<regex_node>::s_iterator_to(node);

			re_list.splice(re_list.begin(), re_list, re_in_list); // move to the begin of the list
			assert(&re_list.front() == &node);
			return node.get();
		}

		if (re_list.size() >= 64)
			pop_lru();

		regex_node * new_node = new regex_node(str, size, regex_flags);
		re_set.insert(*new_node);
		re_list.push_front(*new_node);
		return new_node->get();
	}