public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100157] New: Support `__type_pack_element` like Clang
@ 2021-04-20 17:44 vittorio.romeo at outlook dot com
  2021-04-21  6:21 ` [Bug c++/100157] " rguenth at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: vittorio.romeo at outlook dot com @ 2021-04-20 17:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100157

            Bug ID: 100157
           Summary: Support `__type_pack_element` like Clang
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vittorio.romeo at outlook dot com
  Target Milestone: ---

Clang provides a `__type_pack_element` builtin which allows efficient indexing
of parameter packs in variadic templates, and it seems that GCC has no
equivalent.

This forces users interested in minimizing compilation times to resort to
arcane implemenations such as these ones:
https://github.com/kvasir-io/mpl/blob/development/src/kvasir/mpl/sequence/lookup.hpp

A builtin like `__type_pack_element` would not only allow user code to compile
faster, but also anything inside libstdc++ that needs to index a type list
(e.g. `std::tuple_element_t`) would benefit from it.

This is the Clang test driver, to show an usage example:
https://github.com/llvm-mirror/clang/blob/master/test/SemaCXX/type_pack_element.cpp

This is the Clang pull request:
https://reviews.llvm.org/D15421

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-04-26  8:08 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 17:44 [Bug c++/100157] New: Support `__type_pack_element` like Clang vittorio.romeo at outlook dot com
2021-04-21  6:21 ` [Bug c++/100157] " rguenth at gcc dot gnu.org
2022-06-29 23:27 ` redi at gcc dot gnu.org
2022-06-29 23:33 ` redi at gcc dot gnu.org
2022-06-29 23:38 ` redi at gcc dot gnu.org
2022-06-30 10:39 ` m.cencora at gmail dot com
2022-06-30 11:11 ` redi at gcc dot gnu.org
2022-06-30 11:19 ` redi at gcc dot gnu.org
2022-06-30 11:44 ` m.cencora at gmail dot com
2022-06-30 12:46 ` vittorio.romeo at outlook dot com
2022-06-30 13:05 ` redi at gcc dot gnu.org
2022-06-30 13:08 ` redi at gcc dot gnu.org
2022-06-30 13:09 ` vittorio.romeo at outlook dot com
2022-06-30 13:14 ` redi at gcc dot gnu.org
2022-11-29 15:28 ` pdimov at gmail dot com
2023-04-19 19:37 ` cvs-commit at gcc dot gnu.org
2023-04-26  6:55 ` rguenth at gcc dot gnu.org
2023-04-26  8:08 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).