|
2 | 2 | // subject to the Boost Software License, Version 1.0. (See accompanying |
3 | 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
4 | 4 |
|
| 5 | +#include <boost/iterator/is_lvalue_iterator.hpp> |
5 | 6 | #include <deque> |
6 | 7 | #include <iterator> |
7 | 8 | #include <cstddef> // std::ptrdiff_t |
| 9 | +#include <boost/config.hpp> |
8 | 10 | #include <boost/noncopyable.hpp> |
9 | | -#include <boost/iterator/is_lvalue_iterator.hpp> |
10 | 11 |
|
11 | 12 | struct v |
12 | 13 | { |
@@ -168,5 +169,25 @@ int main() |
168 | 169 | static_assert(!boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<float>>::value, |
169 | 170 | "boost::is_non_const_lvalue_iterator<constant_lvalue_iterator<float>>::value is expected to be false."); |
170 | 171 |
|
| 172 | +#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) |
| 173 | + static_assert(boost::is_lvalue_iterator_v<v*>, |
| 174 | + "boost::is_lvalue_iterator_v<v*> is expected to be true."); |
| 175 | + static_assert(boost::is_lvalue_iterator_v<v const*>, |
| 176 | + "boost::is_lvalue_iterator_v<v const*> is expected to be true."); |
| 177 | + static_assert(!boost::is_lvalue_iterator_v<proxy_iterator<int>>, |
| 178 | + "boost::is_lvalue_iterator_v<proxy_iterator<int>> is expected to be false."); |
| 179 | + static_assert(!boost::is_lvalue_iterator_v<value_iterator>, |
| 180 | + "boost::is_lvalue_iterator_v<value_iterator> is expected to be false."); |
| 181 | + |
| 182 | + static_assert(boost::is_non_const_lvalue_iterator_v<v*>, |
| 183 | + "boost::is_non_const_lvalue_iterator_v<v*> is expected to be true."); |
| 184 | + static_assert(!boost::is_non_const_lvalue_iterator_v<v const*>, |
| 185 | + "boost::is_non_const_lvalue_iterator_v<v const*> is expected to be false."); |
| 186 | + static_assert(!boost::is_non_const_lvalue_iterator_v<proxy_iterator<int>>, |
| 187 | + "boost::is_non_const_lvalue_iterator_v<proxy_iterator<int>> is expected to be false."); |
| 188 | + static_assert(!boost::is_non_const_lvalue_iterator_v<value_iterator>, |
| 189 | + "boost::is_non_const_lvalue_iterator_v<value_iterator> is expected to be false."); |
| 190 | +#endif // !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) |
| 191 | + |
171 | 192 | return 0; |
172 | 193 | } |
0 commit comments