Merge pull request #4 from henriquegemignani/bugfix/algorithm-header

algorithm.hpp header fixes

Former-commit-id: ec3349c646
This commit is contained in:
Phillip Stephens 2022-09-30 05:52:25 -07:00 committed by GitHub
commit 6ceca123e4
3 changed files with 9 additions and 16 deletions

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

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

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();