15 #ifndef PAAL_AUCTION_UTILS_HPP
16 #define PAAL_AUCTION_UTILS_HPP
22 #include <boost/range/adaptor/transformed.hpp>
23 #include <boost/range/algorithm/min_element.hpp>
24 #include <boost/range/distance.hpp>
25 #include <boost/range/empty.hpp>
38 template <
class Auction>
40 return boost::distance(auction.template get<items>());
49 template <
class Auction>
51 return boost::distance(auction.template get<bidders>());
60 template <
class Auction>
61 typename paal::auctions::auction_traits<Auction>::copies_num_t
64 assert(!boost::empty(auction.template get<items>()));
65 using item =
typename auction_traits<Auction>::item_t;
68 return auction.template call<get_copies_num>(std::forward<item>(i));
75 #endif // PAAL_AUCTION_UTILS_HPP
auto min_element_functor(Range &&range, Functor f)
combination of boost::min_element and boost::adaptors::transformed
auto bidders_number(Auction &&auction)
Returns the number of bidders in an auction.
auto items_number(Auction &&auction)
Returns the number of different kinds of items in an auction.
paal::auctions::auction_traits< Auction >::copies_num_t get_minimum_copies_num(Auction &&auction)
Returns minimum number of copies of an item in an auction.