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_VALUE_NEXT_HH
00027 # define MLN_VALUE_NEXT_HH
00028
00032
00033 # include <mln/value/label.hh>
00034
00035
00036 namespace mln
00037 {
00038
00039 namespace value
00040 {
00041
00042 template <typename V>
00043 V
00044 next(const V&);
00045
00046
00047 # ifndef MLN_INCLUDE_ONLY
00048
00049
00050
00051
00052 namespace implementation
00053 {
00054
00055 namespace generic
00056 {
00057
00058 template <typename V>
00059 inline
00060 V
00061 next(const V& v)
00062 {
00063 return v + 1;
00064 }
00065
00066 }
00067
00068
00069 template <unsigned n>
00070 inline
00071 mln::value::label<n>
00072 next_label(const mln::value::label<n>& v)
00073 {
00074 return v.next();
00075 }
00076
00077 }
00078
00079
00080
00081
00082
00083 namespace internal
00084 {
00085
00086 template <unsigned n>
00087 inline
00088 label<n>
00089 next_dispatch(const label<n>& v)
00090 {
00091 return implementation::next_label(v);
00092 }
00093
00094
00095 template <typename V>
00096 inline
00097 V
00098 next_dispatch(const V& v)
00099 {
00100 return implementation::generic::next(v);
00101 }
00102
00103 }
00104
00105
00106
00107
00108
00109 template <typename V>
00110 inline
00111 V
00112 next(const V& v)
00113 {
00114 return internal::next_dispatch(v);
00115 }
00116
00117
00118 # endif // ! MLN_INCLUDE_ONLY
00119
00120
00121 }
00122
00123 }
00124
00125 #endif // ! MLN_VALUE_NEXT_HH