PeriDyno 1.0.0
Loading...
Searching...
No Matches
functional_base.h
Go to the documentation of this file.
1#ifndef FUNCTIONAL_BASE_H
2#define FUNCTIONAL_BASE_H
3
4#include "Platform.h"
5
6namespace dyno
7{
8 template <typename Argument, typename Result>
10 {
11 typedef Argument argument_type;
12 typedef Result result_type;
13 DYN_FUNC unary_function() = default;
14 };
15
16
17 template <typename Argument1, typename Argument2, typename Result>
19 {
20 typedef Argument1 first_argument_type;
21 typedef Argument2 second_argument_type;
22 typedef Result result_type;
23 DYN_FUNC binary_function() = default;
24 };
25
26 template <typename T = void>
27 struct less : public binary_function<T, T, bool>
28 {
29 DYN_FUNC constexpr bool operator()(const T& a, const T& b) const
30 {
31 return a < b;
32 }
33 };
34
35 template <typename T = void>
36 struct greater : public binary_function<T, T, bool>
37 {
38 DYN_FUNC constexpr bool operator()(const T& a, const T& b) const
39 {
40 return a > b;
41 }
42 };
43
44 template <typename T = void>
45 struct predicate : public binary_function<T, T, bool> {
46 DYN_FUNC constexpr bool operator()(const T& a, const T& b) const
47 {
48 return a == b;
49 }
50 };
51}
52
53
54#endif // FUNCTIONAL_BASE
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
DYN_FUNC binary_function()=default
DYN_FUNC constexpr bool operator()(const T &a, const T &b) const
DYN_FUNC constexpr bool operator()(const T &a, const T &b) const
DYN_FUNC constexpr bool operator()(const T &a, const T &b) const
DYN_FUNC unary_function()=default