brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · a2ffd36 Raw
47 lines · 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//===----------------------------------------------------------------------===//8 9#ifndef _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H10#define _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H11 12#include <__config>13 14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15#  pragma GCC system_header16#endif17 18_LIBCPP_BEGIN_NAMESPACE_STD19 20namespace _Algorithm {21struct __fill_n {};22} // namespace _Algorithm23 24template <class>25struct __single_iterator;26 27// This struct allows specializing algorithms for specific arguments. This is useful when we know a more efficient28// algorithm implementation for e.g. library-defined iterators. _Alg is one of tags defined inside the _Algorithm29// namespace above. _Ranges is an essentially arbitrary subset of the arguments to the algorithm that are used for30// dispatching. This set is specific to the algorithm: look at each algorithm to see which arguments they use for31// dispatching to specialized algorithms.32//33// A specialization of `__specialized_algorithm` has to define `__has_algorithm` to true for the specialized algorithm34// to be used. This is intended for cases where iterators can do generic unwrapping and forward to a different35// specialization of `__specialized_algorithm`.36//37// If __has_algorithm is true, there has to be an operator() which will get called with the actual arguments to the38// algorithm.39template <class _Alg, class... _Ranges>40struct __specialized_algorithm {41  static const bool __has_algorithm = false;42};43 44_LIBCPP_END_NAMESPACE_STD45 46#endif // _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H47