Created
April 30, 2017 23:30
-
-
Save JayBazuzi/b2f1b6562018b088ac849275e7f24d8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CPPUNIT_NS | |
{ | |
template <template <typename...> class C, typename... T> struct assertion_traits<C<T...>> | |
{ | |
inline static bool equal(C<T...> const& left, C<T...> const& right) | |
{ | |
return std::equal( | |
left.cbegin(), left.cend(), right.cbegin(), assertion_traits<decltype(*(left.cbegin()))>::equal); | |
} | |
inline static std::string toString(C<T...> const& x) | |
{ | |
ostringstream os; | |
os << "["; | |
std::transform( | |
x.cbegin(), x.cend(), ostream_iterator<string>(os, ","), | |
assertion_traits<decltype(*(x.cbegin()))>::toString); | |
os << "]"; | |
return os.str(); | |
} | |
assertion_traits<C<T...>>() = delete; | |
~assertion_traits<C<T...>>() = delete; | |
assertion_traits<C<T...>>(const assertion_traits<C<T...>>&) = delete; | |
assertion_traits<C<T...>>& operator=(const assertion_traits<C<T...>>&) = delete; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment