00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __MAP_JOIN_HH
00018 # define __MAP_JOIN_HH
00019
00020 namespace aurelia {
00021
00024 template <typename Out, typename Strat>
00025 struct map_join_strategy {
00026 private:
00027 Strat s;
00028
00029 public:
00030 map_join_strategy(const Strat& s): s(s) {}
00031
00032 template <typename T>
00033 Out operator()(const T& t) const {
00035 typedef strategy_concept<strategy_model<Strat, typename T::value_type> >
00036 require;
00037
00038 Out ret;
00039
00040 for (typename T::const_iterator i = t.begin(); i != t.end(); ++i) {
00041 auto l = s(*i);
00042 ret.insert(l.begin(), l.end());
00043 }
00044 return ret;
00045 }
00046 };
00047
00054 template <typename Out, typename Strat>
00055 map_join_strategy<Out, Strat> map_join(const Out&, const Strat& s) {
00056 return map_join_strategy<Out, Strat>(s);
00057 }
00058
00059 }
00060
00061 #endif