7 #ifndef IGLOO_HASLENGTHCONSTRAINT_H 8 #define IGLOO_HASLENGTHCONSTRAINT_H 10 #include "./expressions/expression.h" 14 template <
typename ExpectedType>
18 : m_expected(expected) {}
20 template <
typename ActualType>
21 bool operator()(
const ActualType& actual)
const 23 typedef typename ActualType::size_type SizeType;
24 SizeType expectedSize =
static_cast<SizeType
>(m_expected);
25 return (actual.size() == expectedSize);
28 ExpectedType m_expected;
31 template<
typename ExpectedType >
39 return HasLength<int>(0);
47 template<
typename ExpectedType >
52 std::ostringstream builder;
53 builder <<
"of length " << snowhouse::Stringize(constraint.m_expected);
Definition: haslengthconstraint.h:15
Definition: stringize.h:71
Definition: expression.h:17