// // Copyright (c) 1995, 1996 - Jon Seymour // // mapview.h - support for views over maps // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that this notice appears unmodified in all derivative // works. // // The author makes no representations about the suitability of // this software for any purpose. It is provided "as is" // without express or implied warranty. // // For more information about this software, refer to: // // http://www.zeta.org.au/~jon/STL/views/doc/views.html // // Please send comments about this software to: // // Jon Seymour (jon@zeta.org.au) // #ifndef _mapview_h #define _mapview_h #include #include #include // // map_keys // // A transforming view that defines an abstract container // containing the keys in a map. // template struct map_keys : public view, unary_tautology< pair >, pair_first > { typedef view, unary_tautology< pair >, pair_first > super; map_keys(domain_t &domain) : super(domain, predicate_t(), transform_t()) {}; }; // // map_values // // A transforming view that defines an abstract container // containing the values in a map. // template struct map_values : public view, unary_tautology< pair >, pair_second > { typedef view, unary_tautology< pair >, pair_second > super; map_values(domain_t &domain) : super(domain, predicate_t(), transform_t()) {}; }; #endif