/* Boost.MultiIndex test for special set operations. * * Copyright Joaquín M López Muñoz 2003-2004. Use, modification, and * distribution are subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org/libs/multi_index for library home page. */ #include "test_special_set_ops.hpp" #include /* keep it first to prevent nasty warns in MSVC */ #include #include "pre_multi_index.hpp" #include "employee.hpp" #include using namespace boost::multi_index; struct comp_initial { bool operator()(char ch,const std::string& s)const { if(s.empty())return false; return ch(es).lower_bound('J',comp_initial()), get(es).upper_bound('J',comp_initial()))==3); BOOST_CHECK(get(es).find('A',comp_initial())->name[0]=='A'); BOOST_CHECK( std::distance( get(es).lower_bound(27), get(es).upper_bound(40))==3); BOOST_CHECK(es.count(2,employee::comp_id())==1); BOOST_CHECK(es.count(5,employee::comp_id())==0); }