This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67860] [concepts] bug with overloaded, refined function with explicit and variadic template arguments
- From: "chrisb2244 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Oct 2015 08:18:25 +0000
- Subject: [Bug c++/67860] [concepts] bug with overloaded, refined function with explicit and variadic template arguments
- Auto-submitted: auto-generated
- References: <bug-67860-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67860
Christian Butcher <chrisb2244 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |chrisb2244 at gmail dot com
--- Comment #1 from Christian Butcher <chrisb2244 at gmail dot com> ---
A (I hope) similar (and perhaps simpler) code producing this result is
###############################################
#include <algorithm>
template <typename T, typename... U>
concept bool AreType() {
return (std::is_same<T,U>::value && ...);
// return true; gives the same overloaded error
}
// Function with constraint
template<typename T, AreType<T>... U>
bool isValid(U... u) {
return true;
}
// Function with no constraint
template<typename T, typename... U>
bool isValid(U... u) {
return false;
}
int main() {
isValid<int>(1); // also isValid<int>(1, 2, 3); etc
}
###############################################