@@ -162,10 +162,10 @@ namespace attwoodn::expression_tree {
162162 * and the other node that was AND'ed with this node. This node becomes the left child. The other node becomes
163163 * the right child.
164164 */
165- template <typename OtherOp, typename OtherCompValue, typename OtherLeafNode,
166- std::enable_if<std::is_same<OtherLeafNode, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>::value>* = nullptr >
167- expression_tree_op_node<Obj, this_type, OtherLeafNode>* AND (OtherLeafNode* other) {
168- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherLeafNode> (boolean_op::AND);
165+ template <typename OtherOp, typename OtherCompValue>
166+ auto * AND ( expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>* other) {
167+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>;
168+ ret * op_node = new ret (boolean_op::AND);
169169 op_node->set_left (this );
170170 op_node->set_right (other);
171171 return op_node;
@@ -177,10 +177,10 @@ namespace attwoodn::expression_tree {
177177 * and the other node that was OR'ed with this node. This node becomes the left child. The other node becomes
178178 * the right child.
179179 */
180- template <typename OtherOp, typename OtherCompValue, typename OtherLeafNode,
181- std::enable_if<std::is_same<OtherLeafNode, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>::value>* = nullptr >
182- expression_tree_op_node<Obj, this_type, OtherLeafNode>* OR (OtherLeafNode* other) {
183- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherLeafNode> (boolean_op::OR);
180+ template <typename OtherOp, typename OtherCompValue>
181+ auto * OR ( expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>* other) {
182+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>;
183+ ret * op_node = new ret (boolean_op::OR);
184184 op_node->set_left (this );
185185 op_node->set_right (other);
186186 return op_node;
@@ -192,10 +192,10 @@ namespace attwoodn::expression_tree {
192192 * and the other node that was AND'ed with this node. This node becomes the left child. The other node becomes
193193 * the right child.
194194 */
195- template <typename OtherLeftChild, typename OtherRightChild, typename OtherOpNode,
196- std::enable_if<std::is_same<OtherOpNode, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>::value>* = nullptr >
197- expression_tree_op_node<Obj, this_type, OtherOpNode>* AND (OtherOpNode* other) {
198- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherOpNode> (boolean_op::AND);
195+ template <typename OtherLeftChild, typename OtherRightChild>
196+ auto * AND ( expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>* other) {
197+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>;
198+ ret * op_node = new ret (boolean_op::AND);
199199 op_node->set_left (this );
200200 op_node->set_right (other);
201201 return op_node;
@@ -207,10 +207,10 @@ namespace attwoodn::expression_tree {
207207 * and the other node that was OR'ed with this node. This node becomes the left child. The other node becomes
208208 * the right child.
209209 */
210- template <typename OtherLeftChild, typename OtherRightChild, typename OtherOpNode,
211- std::enable_if<std::is_same<OtherOpNode, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>::value>* = nullptr >
212- expression_tree_op_node<Obj, this_type, OtherOpNode>* OR (OtherOpNode* other) {
213- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherOpNode> (boolean_op::OR);
210+ template <typename OtherLeftChild, typename OtherRightChild>
211+ auto * OR ( expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>* other) {
212+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>;
213+ ret * op_node = new ret (boolean_op::OR);
214214 op_node->set_left (this );
215215 op_node->set_right (other);
216216 return op_node;
@@ -289,10 +289,10 @@ namespace attwoodn::expression_tree {
289289 * and the other node that was AND'ed with this node. This node becomes the left child. The other node becomes
290290 * the right child.
291291 */
292- template <typename OtherOp, typename OtherCompValue, typename OtherLeafNode,
293- std::enable_if<std::is_same<OtherLeafNode, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>::value>* = nullptr >
294- expression_tree_op_node<Obj, this_type, OtherLeafNode>* AND (OtherLeafNode* other) {
295- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherLeafNode> (boolean_op::AND);
292+ template <typename OtherOp, typename OtherCompValue>
293+ auto * AND ( expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>* other) {
294+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>;
295+ ret * op_node = new ret (boolean_op::AND);
296296 op_node->set_left (this );
297297 op_node->set_right (other);
298298 return op_node;
@@ -304,10 +304,10 @@ namespace attwoodn::expression_tree {
304304 * and the other node that was OR'ed with this node. This node becomes the left child. The other node becomes
305305 * the right child.
306306 */
307- template <typename OtherOp, typename OtherCompValue, typename OtherLeafNode,
308- std::enable_if<std::is_same<OtherLeafNode, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>::value>* = nullptr >
309- expression_tree_op_node<Obj, this_type, OtherLeafNode>* OR (OtherLeafNode* other) {
310- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherLeafNode> (boolean_op::OR);
307+ template <typename OtherOp, typename OtherCompValue>
308+ auto * OR ( expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>* other) {
309+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_leaf_node<Obj, OtherOp, OtherCompValue>>;
310+ ret * op_node = new ret (boolean_op::OR);
311311 op_node->set_left (this );
312312 op_node->set_right (other);
313313 return op_node;
@@ -319,10 +319,10 @@ namespace attwoodn::expression_tree {
319319 * and the other node that was AND'ed with this node. This node becomes the left child. The other node becomes
320320 * the right child.
321321 */
322- template <typename OtherLeftChild, typename OtherRightChild, typename OtherOpNode,
323- std::enable_if<std::is_same<OtherOpNode, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>::value>* = nullptr >
324- expression_tree_op_node<Obj, this_type, OtherOpNode>* AND (OtherOpNode* other) {
325- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherOpNode> (boolean_op::AND);
322+ template <typename OtherLeftChild, typename OtherRightChild>
323+ auto * AND ( expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>* other) {
324+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>;
325+ ret * op_node = new ret (boolean_op::AND);
326326 op_node->set_left (this );
327327 op_node->set_right (other);
328328 return op_node;
@@ -334,10 +334,10 @@ namespace attwoodn::expression_tree {
334334 * and the other node that was OR'ed with this node. This node becomes the left child. The other node becomes
335335 * the right child.
336336 */
337- template <typename OtherLeftChild, typename OtherRightChild, typename OtherOpNode,
338- std::enable_if<std::is_same<OtherOpNode, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>::value>* = nullptr >
339- expression_tree_op_node<Obj, this_type, OtherOpNode>* OR (OtherOpNode* other) {
340- auto * op_node = new expression_tree_op_node<Obj, this_type, OtherOpNode> (boolean_op::OR);
337+ template <typename OtherLeftChild, typename OtherRightChild>
338+ auto * OR ( expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>* other) {
339+ using ret = expression_tree_op_node<Obj, this_type, expression_tree_op_node<Obj, OtherLeftChild, OtherRightChild>>;
340+ ret * op_node = new ret (boolean_op::OR);
341341 op_node->set_left (this );
342342 op_node->set_right (other);
343343 return op_node;
0 commit comments