forked from boostorg/regex
Make sub_match a valid range as per https://svn.boost.org/trac/boost/ticket/11036
This commit is contained in:
@ -162,6 +162,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// Make this type a range, for both Boost.Range, and C++11:
|
||||||
|
//
|
||||||
|
BidiIterator begin()const;
|
||||||
|
BidiIterator end()const;
|
||||||
|
|
||||||
|
|
||||||
#ifdef BOOST_OLD_REGEX_H
|
#ifdef BOOST_OLD_REGEX_H
|
||||||
|
@ -149,10 +149,9 @@ test-suite regex
|
|||||||
: : : <test-info>always_show_run_output : test_collate_info ]
|
: : : <test-info>always_show_run_output : test_collate_info ]
|
||||||
|
|
||||||
|
|
||||||
[ compile concepts/concept_check.cpp ../build//boost_regex
|
[ compile concepts/concept_check.cpp ]
|
||||||
]
|
[ compile concepts/icu_concept_check.cpp ]
|
||||||
[ compile concepts/icu_concept_check.cpp ../build//boost_regex
|
[ compile concepts/range_concept_check.cpp ]
|
||||||
]
|
|
||||||
|
|
||||||
[ run
|
[ run
|
||||||
# sources
|
# sources
|
||||||
|
41
test/concepts/range_concept_check.cpp
Normal file
41
test/concepts/range_concept_check.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2015
|
||||||
|
* John Maddock
|
||||||
|
*
|
||||||
|
* Use, modification and distribution are subject to the
|
||||||
|
* Boost Software License, Version 1.0. (See accompanying file
|
||||||
|
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <boost/regex.hpp>
|
||||||
|
#include <boost/range/concepts.hpp>
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void use_val(const T&){}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void check()
|
||||||
|
{
|
||||||
|
BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<T>));
|
||||||
|
BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept<typename boost::range_iterator<T>::type>));
|
||||||
|
BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversalConcept<typename boost::range_iterator<T>::type>));
|
||||||
|
|
||||||
|
#ifndef BOOST_NO_CXX11_RANGE_BASED_FOR
|
||||||
|
const T val;
|
||||||
|
for(auto item : val)
|
||||||
|
{
|
||||||
|
use_val(item);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
check<boost::smatch>();
|
||||||
|
check<boost::cmatch>();
|
||||||
|
|
||||||
|
check <boost::sub_match<const char*> >();
|
||||||
|
return 0;
|
||||||
|
}
|
Reference in New Issue
Block a user