diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2015-11-05 23:39:12 -0600 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2015-12-11 15:30:27 -0600 |
commit | e95f1b15004d7c0c53673f879a99bf0e1ae9cd97 (patch) | |
tree | a2bb6d4618ea39870dabfd4ee83e49d7bc6b8180 /src/include | |
parent | a17fbd3cb1027617aee6915d9b4a6c8640f562cc (diff) | |
download | talos-hostboot-e95f1b15004d7c0c53673f879a99bf0e1ae9cd97.tar.gz talos-hostboot-e95f1b15004d7c0c53673f879a99bf0e1ae9cd97.zip |
Implement std::vector::operator==
RTC: 124148
Change-Id: Ib93efc0c1f1f4371573037047e39bb6e36e7e536
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21801
Tested-by: Jenkins Server
Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com>
Reviewed-by: Brian Silver <bsilver@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/vector | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/vector b/src/include/vector index 133ba9dae..bbe33df47 100644 --- a/src/include/vector +++ b/src/include/vector @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -684,6 +686,22 @@ namespace std //} }; + template <class T, class U> + bool operator==(const vector<T>& l, const vector<U>& r) + { + if (l.size() != r.size()) return false; + auto p = l.begin(); + auto q = r.begin(); + + while(p != l.end()) + { + if (*p != *q) return false; + ++p; ++q; + } + + return true; + } + }; // end namespace std // ------------------------------------------------------------------------------------------------ |