[libcxx-commits] [libcxx] [libc++] Include __type_traits/invoke.h from __type_traits/result_of.h (PR #106796)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 30 13:59:03 PDT 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/106796

The result_of trait requires the __invoke_of implementation detail, but that is defined under __type_traits, not under __functional. Include the right header directly to remove a dependency from __type_traits to __functional.

>From b83a66035ad90b5f96ea8a905dd023d4e11e0c65 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Fri, 30 Aug 2024 12:22:36 -0400
Subject: [PATCH] [libc++] Include __type_traits/invoke.h from
 __type_traits/result_of.h

The result_of trait requires the __invoke_of implementation detail,
but that is defined under __type_traits, not under __functional.
Include the right header directly to remove a dependency from
__type_traits to __functional.
---
 libcxx/include/__type_traits/result_of.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/__type_traits/result_of.h b/libcxx/include/__type_traits/result_of.h
index f00fa8e9be7f73..73a19447520663 100644
--- a/libcxx/include/__type_traits/result_of.h
+++ b/libcxx/include/__type_traits/result_of.h
@@ -10,7 +10,7 @@
 #define _LIBCPP___TYPE_TRAITS_RESULT_OF_H
 
 #include <__config>
-#include <__functional/invoke.h>
+#include <__type_traits/invoke.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header



More information about the libcxx-commits mailing list