algorithm.hpp header fixes

Former-commit-id: 675a1904c4
This commit is contained in:
Henrique Gemignani Passos Lima 2022-09-30 14:49:03 +03:00
parent 4e754e9163
commit 1e59dd91fc
3 changed files with 9 additions and 16 deletions

View File

@ -1,18 +1,10 @@
#ifndef _RSTL_MATH_HPP #ifndef _RSTL_ALGORITHM_HPP
#define _RSTL_MATH_HPP #define _RSTL_ALGORITHM_HPP
#include "rstl/pointer_iterator.hpp" #include "rstl/pointer_iterator.hpp"
namespace rstl { namespace rstl {
template < typename T > 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 > template < class Iter, class T >
inline Iter find(Iter first, Iter last, const T& val) { 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; return first;
} }
} // namespace rstl } // namespace rstl
#endif // _RSTL_MATH_HPP #endif // _RSTL_ALGORITHM_HPP

View File

@ -5,12 +5,13 @@
namespace rstl { namespace rstl {
template < typename T > template < typename T >
static inline const T& max_val(const T& a, const T& b) { inline const T& min_val(const T& a, const T& b) {
return a > b ? a : b; return (b < a) ? b : a;
} }
template < typename T > template < typename T >
static inline const T& min_val(const T& a, const T& b) { inline const T& max_val(const T& a, const T& b) {
return a < b ? a : b; return (a < b) ? b : a;
} }
} // namespace rstl } // namespace rstl

View File

@ -2,7 +2,7 @@
#include "Kyoto/Streams/CInputStream.hpp" #include "Kyoto/Streams/CInputStream.hpp"
#include "rstl/algorithm.hpp" #include "rstl/math.hpp"
CColor::CColor(CInputStream& in) { CColor::CColor(CInputStream& in) {
float r = in.ReadFloat(); float r = in.ReadFloat();