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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H 10 #define _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H 11 12 #include <__config> 13 14 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 15 # pragma GCC system_header 16 #endif 17 18 _LIBCPP_BEGIN_NAMESPACE_STD 19 20 // Tags to represent the canonical operations 21 struct __equal_tag {}; 22 struct __plus_tag {}; 23 struct __less_tag {}; 24 25 // This class template is used to determine whether an operation "desugars" 26 // (or boils down) to a given canonical operation. 27 // 28 // For example, `std::equal_to<>`, our internal `std::__equal_to` helper and 29 // `ranges::equal_to` are all just fancy ways of representing a transparent 30 // equality operation, so they all desugar to `__equal_tag`. 31 // 32 // This is useful to optimize some functions in cases where we know e.g. the 33 // predicate being passed is actually going to call a builtin operator, or has 34 // some specific semantics. 35 template <class _CanonicalTag, class _Operation, class... _Args> 36 inline const bool __desugars_to_v = false; 37 38 _LIBCPP_END_NAMESPACE_STD 39 40 #endif // _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H 41