void foo(concept<T>&& c)
{
bar(std::forward<concept<T>>(c));
}
void foo(concept<T>&& c)
{
bar(std::forward<decltype(c)>(c));
}
But is it really possible in the current TS to use constrained type specifier to declare local variables inside a body of abbreviated function template?
template <class T, class U>
concept bool some_concept = true;
void foo(some_concept<int>)
{
some_concept<int> a = 0;
}
struct A
{
A(int a){std::cout << __PRETTY_FUNCTION__<< ": " << a << std::endl;}
};
int main()
{
A a(3);
foo(a); // the program prints only one line: "A::A(int): 3"
}
--
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/.
From: Andrew Sutton Sent: Thursday, June 9, 2016 10:39 AM To: SG8 - Concepts Reply To: conc...@isocpp.org Subject: Re: [concepts] Can I use constrained-type-specifier in a body of abbreviated function template? |
But these are still the same type:void foo(some_concept<int> a, some_concept<int> b){some_concept<int> c = 0;}So a and b are the same type, but c isn't?
Or did we finally change that?
void foo(some_concept<int> a, some_concept<int> b){some_concept<int> c = 0;}So a and b are the same type, but c isn't?