From ab3c50593cc1921048b19d30f4bf42955058add7 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 16 Dec 2014 00:30:07 +0000 Subject: [PATCH] Add test to ensure that iterator_traits doesn't have a value type git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224295 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../iterator.traits/empty.pass.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/iterators/iterator.primitives/iterator.traits/empty.pass.cpp b/test/iterators/iterator.primitives/iterator.traits/empty.pass.cpp index 0da7f84c..e48e44b3 100644 --- a/test/iterators/iterator.primitives/iterator.traits/empty.pass.cpp +++ b/test/iterators/iterator.primitives/iterator.traits/empty.pass.cpp @@ -20,7 +20,19 @@ struct not_an_iterator { }; +template +struct has_value_type +{ +private: + struct two {char lx; char lxx;}; + template static two test(...); + template static char test(typename _Up::value_type* = 0); +public: + static const bool value = sizeof(test<_Tp>(0)) == 1; +}; + int main() { typedef std::iterator_traits It; + static_assert(!(has_value_type::value), ""); }