Beispiel #1
0
static bool operator==(int_set const & v1, int_splay_tree const & v2) {
    buffer<int> b;
    // std::cout << v2 << "\n";
    // std::for_each(v1.begin(), v1.end(), [](int v) { std::cout << v << " "; }); std::cout << "\n";
    v2.to_buffer(b);
    if (v1.size() != b.size())
        return false;
    for (unsigned i = 0; i < b.size(); i++) {
        if (v1.find(b[i]) == v1.end())
            return false;
    }
    return true;
}
Beispiel #2
0
	fcppt::optional::reference<
		int const
	>
	optional_int_ref;

	BOOST_CHECK_EQUAL(
		fcppt::container::find_opt(
			set,
			strong_int(
				3
			)
		),
		optional_int_ref(
			fcppt::make_cref(
				*set.find(
					3
				)
			)
		)
	);

	BOOST_CHECK(
		!fcppt::container::find_opt(
			set,
			strong_int(
				4
			)
		).has_value()
	);
}