diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2011-10-17 15:06:56 -0500 |
---|---|---|
committer | Douglas R. Gilbert <dgilbert@us.ibm.com> | 2011-10-26 17:16:18 -0500 |
commit | 06c656ca04fd9e1b36dac55bedfcd3694564c24c (patch) | |
tree | 6e6e2cad48f121d426fdb32315a491d81b879c9a /src/include/functional | |
parent | 35a8280b204334d8976faa63a8a79e3630017e86 (diff) | |
download | talos-hostboot-06c656ca04fd9e1b36dac55bedfcd3694564c24c.tar.gz talos-hostboot-06c656ca04fd9e1b36dac55bedfcd3694564c24c.zip |
STL map support based on STL list
Change-Id: Ifd693b0911b0f76114564920dbb86f1cefa6f838
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/450
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Tested-by: Jenkins Server
Diffstat (limited to 'src/include/functional')
-rw-r--r-- | src/include/functional | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/include/functional b/src/include/functional new file mode 100644 index 000000000..34f79308b --- /dev/null +++ b/src/include/functional @@ -0,0 +1,71 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/functional $ +// +// IBM CONFIDENTIAL +// +// COPYRIGHT International Business Machines Corp. 2011 +// +// p1 +// +// Object Code Only (OCO) source materials +// Licensed Internal Code Source Materials +// IBM HostBoot Licensed Internal Code +// +// The source code for this program is not published or other- +// wise divested of its trade secrets, irrespective of what has +// been deposited with the U.S. Copyright Office. +// +// Origin: 30 +// +// IBM_PROLOG_END +#ifndef _FUNCTIONAL_H +#define _FUNCTIONAL_H + +// See C++ spec + +namespace std +{ + template<typename A1, typename A2, typename R> + struct binary_function + { + typedef A1 first_argument_type; ///< type of the first argument + typedef A2 second_argument_type; ///< type of the second argument + typedef R result_type; ///< type of the return type + }; + + /** + * less template + */ + template<typename T> + struct less : public binary_function<T, T, bool> + { + /** + * operator() + * @param[in] x first object + * @param[in] y second object + * @return true if x < y otherwise false + */ + bool operator()(const T& x, const T& y) const + { + return x < y; + } + }; + + template<typename T> + struct greater : public binary_function<T, T, bool> + { + /** + * operator() + * @param[in] x first object + * @param[in] y second object + * @return true if x > y otherwise false + */ + bool operator()(const T& x, const T& y) const + { return x > y; } + }; + + +}; +#endif |