Path: blob/main/contrib/llvm-project/libcxx/include/__algorithm/find_if.h
35233 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___ALGORITHM_FIND_IF_H10#define _LIBCPP___ALGORITHM_FIND_IF_H1112#include <__config>1314#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15# pragma GCC system_header16#endif1718_LIBCPP_BEGIN_NAMESPACE_STD1920template <class _InputIterator, class _Predicate>21_LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator22find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {23for (; __first != __last; ++__first)24if (__pred(*__first))25break;26return __first;27}2829_LIBCPP_END_NAMESPACE_STD3031#endif // _LIBCPP___ALGORITHM_FIND_IF_H323334