summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
commit062cd07342edc2b003555e90dd2cee0514b9f64a (patch)
tree3c73893dae8a9380c9f24e9c5822c5ec6bf671d5 /vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
parentffee481435ac0afe3f9a5a3eb07b2f2a46467089 (diff)
Add BanditCpp 1.1.4 test harness
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h')
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
new file mode 100644
index 00000000..8b6b7d12
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
@@ -0,0 +1,46 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ANDEXPRESSION_H
+#define IGLOO_ANDEXPRESSION_H
+
+#include "./expression_fwd.h"
+
+namespace snowhouse {
+
+ template< typename LeftExpression, typename RightExpression >
+ struct AndExpression : Expression< AndExpression<LeftExpression, RightExpression> >
+ {
+ AndExpression(const LeftExpression& left, const RightExpression& right)
+ : m_left(left)
+ , m_right(right)
+ {
+ }
+
+ template< typename ActualType >
+ bool operator()(const ActualType& actual) const
+ {
+ return (m_left(actual) && m_right(actual));
+ }
+
+ LeftExpression m_left;
+ RightExpression m_right;
+ };
+
+ template< typename LeftExpression, typename RightExpression >
+ struct Stringizer< AndExpression<LeftExpression, RightExpression> >
+ {
+ static std::string ToString(const AndExpression<LeftExpression, RightExpression>& expression)
+ {
+ std::ostringstream builder;
+ builder << Stringize(expression.m_left) << " and " << Stringize(expression.m_right);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif