algorithm.hpp header fixes

This commit is contained in:
Henrique Gemignani Passos Lima
2022-09-30 15:46:54 +03:00
parent e39a8e4c47
commit 675a1904c4
3 changed files with 9 additions and 16 deletions
+3 -11
View File
@@ -1,18 +1,10 @@
#ifndef _RSTL_MATH_HPP
#define _RSTL_MATH_HPP
#ifndef _RSTL_ALGORITHM_HPP
#define _RSTL_ALGORITHM_HPP
#include "rstl/pointer_iterator.hpp"
namespace rstl {
template < typename T >
inline const T& min_val(const T& a, const T& b) {
return (b < a) ? b : a;
}
template < typename T >
inline const T& max_val(const T& a, const T& b) {
return (a < b) ? b : a;
}
template < class Iter, class T >
inline Iter find(Iter first, Iter last, const T& val) {
@@ -21,4 +13,4 @@ inline Iter find(Iter first, Iter last, const T& val) {
return first;
}
} // namespace rstl
#endif // _RSTL_MATH_HPP
#endif // _RSTL_ALGORITHM_HPP
+5 -4
View File
@@ -5,12 +5,13 @@
namespace rstl {
template < typename T >
static inline const T& max_val(const T& a, const T& b) {
return a > b ? a : b;
inline const T& min_val(const T& a, const T& b) {
return (b < a) ? b : a;
}
template < typename T >
static inline const T& min_val(const T& a, const T& b) {
return a < b ? a : b;
inline const T& max_val(const T& a, const T& b) {
return (a < b) ? b : a;
}
} // namespace rstl
+1 -1
View File
@@ -2,7 +2,7 @@
#include "Kyoto/Streams/CInputStream.hpp"
#include "rstl/algorithm.hpp"
#include "rstl/math.hpp"
CColor::CColor(CInputStream& in) {
float r = in.ReadFloat();