mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
add advance C++14 constexpr version
This commit is contained in:
parent
b76e0aeb7f
commit
a90bbd5f38
28 changed files with 145 additions and 46 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <initializer_list>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/algorithm/detail/max.hpp>
|
||||
#include <sprout/algorithm/max_element.hpp>
|
||||
#include <sprout/iterator/ptr_index_iterator.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
@ -18,18 +19,6 @@
|
|||
namespace sprout {
|
||||
|
||||
// 25.4.7 Minimum and maximum
|
||||
template<typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR T const&
|
||||
max(T const& a, T const& b, Compare comp) {
|
||||
return comp(a, b) ? b : a;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline SPROUT_CONSTEXPR T const&
|
||||
max(T const& a, T const& b) {
|
||||
return sprout::max(a, b, NS_SSCRISK_CEL_OR_SPROUT::less<T>());
|
||||
}
|
||||
|
||||
#ifdef SPROUT_NO_CXX14_INITIALIZER_LIST
|
||||
template<typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR T
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue