1 /* 2 * 3 * Copyright (c) 2015 4 * John Maddock 5 * 6 * Use, modification and distribution are subject to the 7 * Boost Software License, Version 1.0. (See accompanying file 8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 * 10 */ 11 12 #include <boost/regex.hpp> 13 #include <boost/range/concepts.hpp> 14 15 template <class T> use_val(const T &)16void use_val(const T&){} 17 18 template <class T> check()19void check() 20 { 21 BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<T>)); 22 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept<typename boost::range_iterator<T>::type>)); 23 BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversalConcept<typename boost::range_iterator<T>::type>)); 24 25 #ifndef BOOST_NO_CXX11_RANGE_BASED_FOR 26 const T val; 27 for(auto item : val) 28 { 29 use_val(item); 30 } 31 #endif 32 } 33 main()34int main() 35 { 36 check<boost::smatch>(); 37 check<boost::cmatch>(); 38 39 check <boost::sub_match<const char*> >(); 40 return 0; 41 } 42