public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56506] variadic class template specialization not selected as best match Date: Sun, 03 Mar 2013 19:47:00 -0000 [thread overview] Message-ID: <bug-56506-4-g6TR1utFzw@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-56506-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56506 Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler at | |googlemail dot com --- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-03-03 19:46:42 UTC --- I don't think that either example should be accepted. My understanding is, that the second T is still considered as a parameter pack but not as an expansion (because it is not followed by ...) at the time of pattern match checking, therefore the compiler would try to match a sequence of expansions from the first T... with a corresponding parameter pack. But this pack is always considered as a different type, even if it would contain the same single type (e.g. consider an argument type Y<Z<int>, int> where we would try to match 'int' with '[int]' where I use square brackets to denote the still existing pack). So both cannot be the same type, and this specialization can never be found. It would work, if you would declare the partial specialization as: template<typename... T, typename... U> struct X<Y<Z<T...>, U>...> { typedef int type; }; because now the compiler don't needs to cross-match corresponding T expansions with the U pack. I understand that this is a somewhat more generous specialization as you would like to have, though.
next prev parent reply other threads:[~2013-03-03 19:47 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-03-02 3:04 [Bug c++/56506] New: " mmehlich at semanticdesigns dot com 2013-03-02 18:55 ` [Bug c++/56506] " mmehlich at semanticdesigns dot com 2013-03-03 19:47 ` daniel.kruegler at googlemail dot com [this message] 2013-03-04 17:00 ` mmehlich at semanticdesigns dot com 2013-03-05 20:18 ` daniel.kruegler at googlemail dot com 2024-04-04 6:41 ` pinskia at gcc dot gnu.org 2024-04-04 6:41 ` pinskia at gcc dot gnu.org 2024-04-04 6:44 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-56506-4-g6TR1utFzw@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).