Lines Matching refs:animals
34 Let us assume that we have an OO-hierarchy of animals
58 Then the managing of the animals is straight-forward. Imagine a
135 boost::ptr_vector<animal> animals( 10u );
137 will reserve room for 10 animals.
142 To keep an ordering on our animals, we could use a ``ptr_set``::
149 This requires that ``operator<()`` is defined for animals. One
157 if we wanted to keep the animals sorted by name.
159 Maybe you want to keep all the animals in zoo ordered wrt.
160 their name, but it so happens that many animals have the
182 boost::ptr_map<std::string,animal> animals;
183 animals["bobo"].set_name("bobo");
185 This requires a default constructor for animals and
197 boost::ptr_multimap<std::string,animal> animals;
200 ptr_map_insert<monkey>( animals )( "bobo", "bobo" );
201 ptr_map_insert<elephant>( animals )( "bobo", "bobo" );
202 ptr_map_insert<whale>( animals )( "anna", "anna" );
203 ptr_map_insert<emu>( animals )( "anna", "anna" );
214 animals_type animals;
216 animals.insert( animals.end(), new dodo("fido") );
217 animals.insert( animals.begin(), 0 ) // ok
222 for( animals_type::iterator i = animals.begin();
223 i != animals.end(); ++i )
232 i != animals.size(); ++i )
234 if( !animals.is_null(i) )
235 animals[i].eat();
287 boost::ptr_vector<animal> animals = monkeys;
292 boost::ptr_map<std::string,animal> animals = monkeys;
327 boost::ptr_deque<animal> animals = get_zoo();