00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MLN_FUN_I2V_ALL_TO_HH
00027 # define MLN_FUN_I2V_ALL_TO_HH
00028
00032
00033 # include <mln/core/concept/function.hh>
00034
00035
00036 namespace mln
00037 {
00038
00039 namespace fun
00040 {
00041
00042 namespace i2v
00043 {
00044
00045 template <typename T>
00046 struct all_to : public Function_v2v< all_to<T> >
00047 {
00048 typedef T result;
00049 all_to(T t);
00050 template <typename U>
00051 T operator()(const U&) const;
00052 private:
00053 T t_;
00054 };
00055
00056 }
00057
00058 }
00059
00060 template <typename T>
00061 fun::i2v::all_to<T> all_to(T t);
00062
00063
00064 # ifndef MLN_INCLUDE_ONLY
00065
00066 namespace fun
00067 {
00068
00069 namespace i2v
00070 {
00071
00072 template <typename T>
00073 inline
00074 all_to<T>::all_to(T t)
00075 : t_(t)
00076 {
00077 }
00078
00079 template <typename T>
00080 template <typename U>
00081 inline
00082 T
00083 all_to<T>::operator()(const U&) const
00084 {
00085 return t_;
00086 }
00087
00088 }
00089
00090 }
00091
00092 template <typename T>
00093 inline
00094 fun::i2v::all_to<T> all_to(T t)
00095 {
00096 fun::i2v::all_to<T> tmp(t);
00097 return tmp;
00098 }
00099
00100 # endif // ! MLN_INCLUDE_ONLY
00101
00102 }
00103
00104
00105 #endif // ! MLN_FUN_I2V_ALL_TO_HH