Files

39 lines
1.0 KiB
C++

/*
Copyright (c) T. Zachary Laine 2018.
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)
*/
#ifndef ACTIV_BOOST_ALGORITHM_FIND_NOT_HPP
#define ACTIV_BOOST_ALGORITHM_FIND_NOT_HPP
#include <utility>
#include <ActivBoost/config.hpp>
#include <ActivBoost/range/begin.hpp>
#include <ActivBoost/range/end.hpp>
namespace Boost { namespace algorithm {
template<typename InputIter, typename Sentinel, typename T>
ACTIV_BOOST_CXX14_CONSTEXPR
InputIter find_not(InputIter first, Sentinel last, const T & x)
{
for (; first != last; ++first) {
if (*first != x)
break;
}
return first;
}
template<typename Range, typename T>
ACTIV_BOOST_CXX14_CONSTEXPR
typename Boost::range_iterator<Range>::type find_not(Range & r, const T & x)
{
return ::Boost::algorithm::find_not(Boost::begin(r), Boost::end(r), x);
}
}} // namespace Boost and algorithm
#endif // ACTIV_BOOST_ALGORITHM_FIND_NOT_HPP