From d97ee68238662d7ff4787252dd6cdc0902ec58cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Wed, 29 Oct 2014 15:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90equal=5Fto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/Functional.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/TinySTL/Functional.h b/TinySTL/Functional.h index 85a86ee..a842a04 100644 --- a/TinySTL/Functional.h +++ b/TinySTL/Functional.h @@ -13,5 +13,16 @@ namespace TinySTL{ return x < y; } }; + //********** [equal_to] **************** + template + struct equal_to{ + typedef T first_argument_type; + typedef T second_argument_type; + typedef bool result_type; + + result_type operator()(const first_argument_type& x, const second_argument_type& y){ + return x == y; + } + }; } #endif \ No newline at end of file