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
}

###############################################

Reply via email to