From c71b891c870b6fe6d67a63e51b983f065968cddf Mon Sep 17 00:00:00 2001 From: cheparukhin Date: Fri, 8 Jul 2016 19:06:58 +0100 Subject: [PATCH] Add test for ostream operator --- test/cxxtest/general.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/cxxtest/general.h b/test/cxxtest/general.h index a680da5..caa5414 100644 --- a/test/cxxtest/general.h +++ b/test/cxxtest/general.h @@ -1,3 +1,4 @@ +#include #include #include #include @@ -125,6 +126,17 @@ static_assert_1(*Channel::_values().begin() == +Channel::Red); static_assert_1(*(Channel::_values().end() - 1) == +Channel::Blue); static_assert_1(Channel::_values()[1] == +Channel::Green); +namespace name_clash_test { + +struct Foo {}; +std::ostream& operator<<(std::ostream&, Foo); + +BETTER_ENUM(Enum, int, ONE, TWO, THREE) + +static_assert_1((std::is_same() << +Enum::ONE), std::ostream&>())); + +} + #ifdef BETTER_ENUMS_CONSTEXPR_TO_STRING constexpr bool same_string(const char *r, const char *s, size_t index = 0)