add advance C++14 constexpr version

This commit is contained in:
bolero-MURAKAMI 2013-10-05 13:35:26 +09:00
parent b76e0aeb7f
commit a90bbd5f38
28 changed files with 145 additions and 46 deletions

View file

@ -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