Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
max3.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 #include <cstring>
9 
10 template <typename T>
11 inline T const& max(T const& a, T const& b)
12 {
13  return a < b ? b : a;
14 }
15 
16 template <typename T>
17 inline T* const& max(T* const& a, T* const& b)
18 {
19  return *a < *b ? b : a;
20 }
21 
22 inline int const& max(int const& a, int const& b) { return a < b ? b : a; }
23 
24 
25 inline char const* const& max(char const* const& a, char const* const& b) { return std::strcmp(a, b) < 0 ? b : a; }
26 
27 template <typename T>
28 inline T const& max(T const& a, T const& b, T const& c)
29 {
30  return max(max(a, b), c);
31 }
T const & max(T const &a, T const &b)
Definition: max3.hpp:11