[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2844ba0 10/11: Suppress PETE's operator==() f
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2844ba0 10/11: Suppress PETE's operator==() for std::vector |
Date: |
Tue, 16 Feb 2021 13:06:23 -0500 (EST) |
branch: master
commit 2844ba037f4114fe457c1f29cf9ddc71e80acb89
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Suppress PETE's operator==() for std::vector
By default, using PETE with std::vector introduced an element-by-element
operator==() (returning a vector) that hid the standard operator==()
defined in <vector> (that returns a scalar bool). Suppressed the
unwanted PETE operation.
* tools/pete-2.1.1/PETE/Tools/PeteOps.in: Edited.
* tools/pete-2.1.1/PETE/OperatorTags.h: Regenerated.
* tools/pete-2.1.1/PETE/Tools/PeteOps.cpp: Regenerated.
* tools/pete-2.1.1/et_vector_operators.hpp: Regenerated.
For future reference--to regenerate:
cd /opt/lmi/src/lmi/tools/pete-2.1.1
make -f Makefile maintainer-clean 2>&1 |less
make -f Makefile 2>&1 |less
make -f Makefile distclean
---
tools/pete-2.1.1/PETE/OperatorTags.h | 32 -----
tools/pete-2.1.1/PETE/Tools/PeteOps.cpp | 10 --
tools/pete-2.1.1/PETE/Tools/PeteOps.in | 8 --
tools/pete-2.1.1/et_vector_operators.hpp | 224 -------------------------------
4 files changed, 274 deletions(-)
diff --git a/tools/pete-2.1.1/PETE/OperatorTags.h
b/tools/pete-2.1.1/PETE/OperatorTags.h
index 674dc5b..fb931b8 100644
--- a/tools/pete-2.1.1/PETE/OperatorTags.h
+++ b/tools/pete-2.1.1/PETE/OperatorTags.h
@@ -499,38 +499,6 @@ struct BinaryReturn<T1, T2, OpGE > {
typedef bool Type_t;
};
-struct OpEQ
-{
- PETE_EMPTY_CONSTRUCTORS(OpEQ)
- template<class T1, class T2>
- inline typename BinaryReturn<T1, T2, OpEQ >::Type_t
- operator()(const T1 &a, const T2 &b) const
- {
- return (a == b);
- }
-};
-
-template<class T1, class T2 >
-struct BinaryReturn<T1, T2, OpEQ > {
- typedef bool Type_t;
-};
-
-struct OpNE
-{
- PETE_EMPTY_CONSTRUCTORS(OpNE)
- template<class T1, class T2>
- inline typename BinaryReturn<T1, T2, OpNE >::Type_t
- operator()(const T1 &a, const T2 &b) const
- {
- return (a != b);
- }
-};
-
-template<class T1, class T2 >
-struct BinaryReturn<T1, T2, OpNE > {
- typedef bool Type_t;
-};
-
struct OpAnd
{
PETE_EMPTY_CONSTRUCTORS(OpAnd)
diff --git a/tools/pete-2.1.1/PETE/Tools/PeteOps.cpp
b/tools/pete-2.1.1/PETE/Tools/PeteOps.cpp
index 0d2967f..1286c55 100644
--- a/tools/pete-2.1.1/PETE/Tools/PeteOps.cpp
+++ b/tools/pete-2.1.1/PETE/Tools/PeteOps.cpp
@@ -114,16 +114,6 @@ void peteOps(map<string,vector<OperatorDescriptor> > &m)
"return (a >= b);",
""));
m["binaryBoolOps"].push_back(
- OperatorDescriptor("OpEQ",
- "operator==",
- "return (a == b);",
- ""));
- m["binaryBoolOps"].push_back(
- OperatorDescriptor("OpNE",
- "operator!=",
- "return (a != b);",
- ""));
- m["binaryBoolOps"].push_back(
OperatorDescriptor("OpAnd",
"operator&&",
"return (a && b);",
diff --git a/tools/pete-2.1.1/PETE/Tools/PeteOps.in
b/tools/pete-2.1.1/PETE/Tools/PeteOps.in
index 598742b..40f6ffe 100644
--- a/tools/pete-2.1.1/PETE/Tools/PeteOps.in
+++ b/tools/pete-2.1.1/PETE/Tools/PeteOps.in
@@ -166,14 +166,6 @@ binaryBoolOps
FUNCTION = "operator>="
EXPR = "return (a >= b);"
-----
- TAG = "OpEQ"
- FUNCTION = "operator=="
- EXPR = "return (a == b);"
------
- TAG = "OpNE"
- FUNCTION = "operator!="
- EXPR = "return (a != b);"
------
TAG = "OpAnd"
FUNCTION = "operator&&"
EXPR = "return (a && b);"
diff --git a/tools/pete-2.1.1/et_vector_operators.hpp
b/tools/pete-2.1.1/et_vector_operators.hpp
index fefe8c7..99019cb 100644
--- a/tools/pete-2.1.1/et_vector_operators.hpp
+++ b/tools/pete-2.1.1/et_vector_operators.hpp
@@ -492,34 +492,6 @@ operator>=(const std::vector<T1> & l,const std::vector<T2>
& r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator==(const std::vector<T1> & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator!=(const std::vector<T1> & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<std::vector<T1> >::Leaf_t,
typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
@@ -814,34 +786,6 @@ operator>=(const std::vector<T1> & l,const Expression<T2>
& r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator==(const std::vector<T1> & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator!=(const std::vector<T1> & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<std::vector<T1> >::Leaf_t,
typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
@@ -1136,34 +1080,6 @@ operator>=(const Expression<T1> & l,const
std::vector<T2> & r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator==(const Expression<T1> & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator!=(const Expression<T1> & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<Expression<T1> >::Leaf_t,
typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
@@ -1458,34 +1374,6 @@ operator>=(const std::vector<T1> & l,const T2 & r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
-operator==(const std::vector<T1> & l,const T2 & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<T2 >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
-operator!=(const std::vector<T1> & l,const T2 & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<std::vector<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<std::vector<T1> >::make(l),
- CreateLeaf<T2 >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<std::vector<T1> >::Leaf_t,
typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
@@ -1780,34 +1668,6 @@ operator>=(const T1 & l,const std::vector<T2> & r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator==(const T1 & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<T1 >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
-operator!=(const T1 & l,const std::vector<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<std::vector<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<T1 >::make(l),
- CreateLeaf<std::vector<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<T1 >::Leaf_t,
typename CreateLeaf<std::vector<T2> >::Leaf_t> >::Expression_t
@@ -2376,34 +2236,6 @@ operator>=(const Expression<T1> & l,const Expression<T2>
& r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator==(const Expression<T1> & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator!=(const Expression<T1> & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<Expression<T1> >::Leaf_t,
typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
@@ -2698,34 +2530,6 @@ operator>=(const Expression<T1> & l,const T2 & r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
-operator==(const Expression<T1> & l,const T2 & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<T2 >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
-operator!=(const Expression<T1> & l,const T2 & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<Expression<T1> >::Leaf_t,
- typename CreateLeaf<T2 >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<Expression<T1> >::make(l),
- CreateLeaf<T2 >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<Expression<T1> >::Leaf_t,
typename CreateLeaf<T2 >::Leaf_t> >::Expression_t
@@ -3020,34 +2824,6 @@ operator>=(const T1 & l,const Expression<T2> & r)
}
template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpEQ,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator==(const T1 & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpEQ,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<T1 >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
-inline typename MakeReturn<BinaryNode<OpNE,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
-operator!=(const T1 & l,const Expression<T2> & r)
-{
- typedef BinaryNode<OpNE,
- typename CreateLeaf<T1 >::Leaf_t,
- typename CreateLeaf<Expression<T2> >::Leaf_t> Tree_t;
- return MakeReturn<Tree_t>::make(Tree_t(
- CreateLeaf<T1 >::make(l),
- CreateLeaf<Expression<T2> >::make(r)));
-}
-
-template<class T1,class T2>
inline typename MakeReturn<BinaryNode<OpAnd,
typename CreateLeaf<T1 >::Leaf_t,
typename CreateLeaf<Expression<T2> >::Leaf_t> >::Expression_t
- [lmi-commits] [lmi] master updated (3143a30 -> c90e25a), Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master b321588 05/11: Demonstrate PETE assignment to std::vector, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master bcec152 08/11: Amend PETE header and footer for generated files, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2741732 07/11: Break a makefile dependency cycle, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2a92707 04/11: Move a comment block that will soon become a test, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 431bdbb 01/11: Do not include PETE in any header except "et_vector.hpp", Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master acac3ad 03/11: Accommodate 21st-century hardware, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master c90e25a 11/11: No longer invoke std::operator==() explicitly for vectors, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 2844ba0 10/11: Suppress PETE's operator==() for std::vector,
Greg Chicares <=
- [lmi-commits] [lmi] master 7f3f834 06/11: Rewrite '*clean*' targets, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 088d2a8 09/11: Regenerate PETE, Greg Chicares, 2021/02/16
- [lmi-commits] [lmi] master 38d5ece 02/11: Further improve physical design, Greg Chicares, 2021/02/16