Compare commits

...

6 Commits

Author SHA1 Message Date
cf5ad341ed Added a missing include. 2015-09-11 19:31:18 +03:00
1f6de83fe2 Merge pull request #20 from MarcelRaad/patch-1
Remove deprecated include
2015-09-11 19:06:38 +03:00
cb6500161b Remove deprecated include
All that boost/iterator.hpp does is pull std::iterator into namespace boost. A comment in that header mentions: "This header is obsolete and will be deprecated."
2015-09-11 17:49:23 +02:00
13610caa36 Update copyright notice; change to_string to avoid UB by calling a different constructor. Fixes #11150 2015-03-28 12:02:41 -07:00
6bcf4f92bf Merge pull request #19 from akumta/patch-1
Update string_ref_test2.cpp
2015-02-27 09:26:11 +03:00
fa8301a56a Update string_ref_test2.cpp
For ticket# 10838
2015-02-25 10:49:14 -08:00
3 changed files with 15 additions and 13 deletions

View File

@ -82,8 +82,10 @@
#ifndef BOOST_OPERATORS_HPP
#define BOOST_OPERATORS_HPP
#include <cstddef>
#include <iterator>
#include <boost/config.hpp>
#include <boost/iterator.hpp>
#include <boost/detail/workaround.hpp>
#if defined(__sgi) && !defined(__GNUC__)
@ -891,13 +893,13 @@ template <class T,
class R = V const &>
struct input_iterator_helper
: input_iteratable<T, P
, boost::iterator<std::input_iterator_tag, V, D, P, R
, std::iterator<std::input_iterator_tag, V, D, P, R
> > {};
template<class T>
struct output_iterator_helper
: output_iteratable<T
, boost::iterator<std::output_iterator_tag, void, void, void, void
, std::iterator<std::output_iterator_tag, void, void, void, void
> >
{
T& operator*() { return static_cast<T&>(*this); }
@ -911,7 +913,7 @@ template <class T,
class R = V&>
struct forward_iterator_helper
: forward_iteratable<T, P
, boost::iterator<std::forward_iterator_tag, V, D, P, R
, std::iterator<std::forward_iterator_tag, V, D, P, R
> > {};
template <class T,
@ -921,7 +923,7 @@ template <class T,
class R = V&>
struct bidirectional_iterator_helper
: bidirectional_iteratable<T, P
, boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
, std::iterator<std::bidirectional_iterator_tag, V, D, P, R
> > {};
template <class T,
@ -931,7 +933,7 @@ template <class T,
class R = V&>
struct random_access_iterator_helper
: random_access_iteratable<T, P, D, R
, boost::iterator<std::random_access_iterator_tag, V, D, P, R
, std::iterator<std::random_access_iterator_tag, V, D, P, R
> >
{
friend D requires_difference_operator(const T& x, const T& y) {

View File

@ -1,5 +1,5 @@
/*
Copyright (c) Marshall Clow 2012-2012.
Copyright (c) Marshall Clow 2012-2015.
Distributed under 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)
@ -82,12 +82,12 @@ namespace boost {
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
template<typename Allocator>
explicit operator std::basic_string<charT, traits, Allocator>() const {
return std::basic_string<charT, traits, Allocator> ( ptr_, len_ );
return std::basic_string<charT, traits, Allocator> ( begin(), end());
}
#endif
std::basic_string<charT, traits> to_string () const {
return std::basic_string<charT, traits> ( ptr_, len_ );
return std::basic_string<charT, traits> ( begin(), end());
}
// iterators

View File

@ -18,7 +18,7 @@
typedef boost::string_ref string_ref;
void ends_with ( const char *arg ) {
const size_t sz = strlen ( arg );
const size_t sz = std::strlen ( arg );
string_ref sr ( arg );
string_ref sr2 ( arg );
const char *p = arg;
@ -48,7 +48,7 @@ void ends_with ( const char *arg ) {
}
void starts_with ( const char *arg ) {
const size_t sz = strlen ( arg );
const size_t sz = std::strlen ( arg );
string_ref sr ( arg );
string_ref sr2 ( arg );
const char *p = arg + std::strlen ( arg ) - 1;
@ -159,7 +159,7 @@ void find ( const char *arg ) {
// Find everything at the end
sr1 = arg;
p = arg + strlen ( arg ) - 1;
p = arg + std::strlen ( arg ) - 1;
while ( !sr1.empty ()) {
string_ref::size_type pos = sr1.rfind(*p);
BOOST_CHECK ( pos == sr1.size () - 1 );
@ -180,7 +180,7 @@ void find ( const char *arg ) {
// Find everything at the end
sr1 = arg;
p = arg + strlen ( arg ) - 1;
p = arg + std::strlen ( arg ) - 1;
while ( !sr1.empty ()) {
string_ref::size_type pos = sr1.find_last_of(*p);
BOOST_CHECK ( pos == sr1.size () - 1 );