From 377a0026ada2588fc7a5450179946f333372a5a2 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Sun, 16 Mar 2014 00:10:18 +0100 Subject: [PATCH] add c14 less, greater --- triqs/utility/c14.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/triqs/utility/c14.hpp b/triqs/utility/c14.hpp index 9a6a319c..c9faa602 100644 --- a/triqs/utility/c14.hpp +++ b/triqs/utility/c14.hpp @@ -39,12 +39,24 @@ namespace std { // use simply std::c14::plus<>() ... template struct plus: std::plus{}; - template<> struct plus { template auto operator()( T&& t, U&& u) const DECL_AND_RETURN(std::forward(t) + std::forward(u)); }; + // use simply std::c14::plus<>() ... + template struct greater: std::greater{}; + template<> struct greater { + template + auto operator()( T&& t, U&& u) const DECL_AND_RETURN(std::forward(t) > std::forward(u)); + }; + + template struct less: std::less{}; + template<> struct less { + template + auto operator()( T&& t, U&& u) const DECL_AND_RETURN(std::forward(t) < std::forward(u)); + }; + template std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); }