Lolly 1.4.27
Loading...
Searching...
No Matches
unary_function.hpp
Go to the documentation of this file.
1
2/******************************************************************************
3 * MODULE : unary_function.hpp
4 * DESCRIPTION: unary functions
5 * COPYRIGHT : (C) 2013 Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
11
12#ifndef UNARY_FUNCTION_H
13#define UNARY_FUNCTION_H
14
15#include "basic.hpp"
16
17#define TMPL template <typename T, typename S>
18
22
24public:
25 inline unary_function_rep () {}
26 inline virtual ~unary_function_rep () {}
27 virtual T eval (const S& arg)= 0;
28};
29
31public:
33 inline T operator() (const S& arg);
34};
36
37TMPL inline T
39 return rep->eval (arg);
40}
41
42TMPL inline bool
46
47#undef TMPL
48
49#endif // defined UNARY_FUNCTION_H
#define ABSTRACT_NULL_TEMPLATE_2_CODE(PTR, TT1, T1, TT2, T2)
Macro for abstract null indirect structure two-template-parameter code definition.
Definition classdef.hpp:521
The list class represents a linked list.
Definition list.hpp:48
virtual T eval(const S &arg)=0
virtual ~unary_function_rep()
T operator()(const S &arg)
ABSTRACT_NULL_TEMPLATE_2(unary_function, T, S)
Structure representing an abstract object with a reference count.
Definition classdef.hpp:49
base class of resources
Definition resource.hpp:23
bool operator==(unary_function< T, S > mw1, unary_function< T, S > mw2)
bool is_nil(unary_function< T, S > l)
#define TMPL