Changeset 1679:e825655c24a4 in lemon-0.x for lemon/maps.h
- Timestamp:
- 09/12/05 11:15:59 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2198
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/maps.h
r1675 r1679 710 710 typename NC = False> 711 711 class FunctorMap : public MapBase<K, V, NC> { 712 const F &f;712 F f; 713 713 public: 714 714 typedef MapBase<K, V, NC> Parent; … … 717 717 718 718 ///Constructor 719 FunctorMap(const F &_f) : f(_f) {}; 720 Value operator[](Key k) const {return f(k);} 719 FunctorMap(const F &_f) : f(_f) {} 720 721 Value operator[](Key k) const { return f(k);} 721 722 }; 722 723 … … 735 736 FunctorMap<F, typename F::argument_type, typename F::result_type, True> 736 737 functorMap(const F &f) { 737 return functorMap<typename F::argument_type,738 typename F::result_type, F>(f);738 return FunctorMap<F, typename F::argument_type, 739 typename F::result_type, True>(f); 739 740 } 740 741 741 742 template <typename K, typename V> inline 742 743 FunctorMap<V (*)(K), K, V, True> functorMap(V (*f)(K)) { 743 return functorMap<K, V, V (*)(K)>(f);744 return FunctorMap<V (*)(K), K, V, True>(f); 744 745 } 745 746
Note: See TracChangeset
for help on using the changeset viewer.