--
You received this message because you are subscribed to the Google Groups "SG8 - Concepts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concepts+u...@isocpp.org.
To post to this group, send email to conc...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/concepts/.
trying to compile this code with gcc-trunk gives the following:
Antons-MacBook-Air:c++ bikineev$ g++ -o 41 41.cc -std=c++1z -fconcepts41.cc:21:52: internal compiler error: in synthesize_implicit_template_parm, at cp/parser.c:37830concept bool button = requires (T t, callable c)^
41.cc:21:52: internal compiler error: Abort trap: 6
среда, 15 июня 2016 г., 14:45:52 UTC+3 пользователь Anton Bikineev написал:Hi SG8,
I haven't found an answer in N4553,but is it possible by design to use constrained-type-specifier to declare constrained variable, like
template <class T>concept bool callable = ...;
template <class T>concept bool button = requires (T t, callable c){{t.on_click(c)};};
Anyway, it would be of a good use.
I have wanted to do something like this as well, but I don't have any ideas on how to make it workable.
The typical workaround is to add an additional template parameter for the additional type:
template <class T, class C>concept bool button =
callable<C> &&
requires (T t, C c) {
{t.on_click(c)};};