AFF --- A container for numbers (array) by Friederich and Forbriger.
min.h
Go to the documentation of this file.
1
36
// include guard
37
#ifndef AFF_MIN_H_VERSION
38
39
#define AFF_MIN_H_VERSION \
40
"AFF_MIN_H V1.1 "
41
42
43
#include<
aff/lib/collector.h
>
44
45
namespace
aff
{
46
47
namespace
func {
48
49
namespace
util {
50
58
template
<
class
C>
59
class
Extractmin
{
60
typedef
typename
C::Tcoc
Tcont
;
61
typedef
typename
C::Tvalue
Tvalue
;
62
public
:
63
typedef
Tvalue
Tretval
;
65
Extractmin
(
const
Tcont
& c):
Mval
(c(c.first())) { }
67
void
operator()
(
const
Tvalue
& v)
68
{
Mval
=
Mval
< v ?
Mval
: v; }
70
Tretval
result
()
const
{
return
(
Mval
); }
71
private
:
72
Tvalue
Mval
;
73
};
// class Extractmin
74
75
}
// namespace util
76
77
/*----------------------------------------------------------------------*/
78
89
template
<
class
C>
90
typename
C::Tvalue
min
(
const
C& c)
91
{
92
return
(aff::func::util::collect<C, aff::func::util::Extractmin>(c));
93
}
// min()
94
95
}
// namespace func
96
97
}
// namespace aff
98
99
#endif // AFF_MIN_H_VERSION (includeguard)
100
101
/* ----- END OF min.h ----- */
aff
Root namespace of library.
Definition:
array.h:148
collector.h
collect values (prototypes)
aff::func::util::Extractmin::operator()
void operator()(const Tvalue &v)
collect another value
Definition:
min.h:67
aff::func::min
C::Tvalue min(const C &c)
Definition:
min.h:90
aff::func::util::Extractmin::Tcont
C::Tcoc Tcont
Definition:
min.h:60
aff::func::util::Extractmin::Extractmin
Extractmin(const Tcont &c)
initialize member data
Definition:
min.h:65
aff::func::util::Extractmin::Tretval
Tvalue Tretval
Definition:
min.h:63
aff::func::util::Extractmin::result
Tretval result() const
return result of operation
Definition:
min.h:70
aff::func::util::Extractmin
Definition:
min.h:59
aff::func::util::Extractmin::Mval
Tvalue Mval
Definition:
min.h:72
aff::func::util::Extractmin::Tvalue
C::Tvalue Tvalue
Definition:
min.h:61
functions
min.h
Generated on Mon Aug 21 2023 17:36:08 for AFF --- A container for numbers (array) by Friederich and Forbriger. by
1.8.14