C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about 8.3/10 (function parameter pack)

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Alberto Ganesh Barbati
Guest





PostPosted: Mon May 21, 2007 5:12 am    Post subject: Question about 8.3/10 (function parameter pack) Reply with quote



Hi,

in 8.3/10 of the latest draft (N2289) the example contains:

template<typename... T> void f(T (* ...T)(int, int);

int add(int, int);
float subtract(int, int);
void g() {
f(add, subtract);
}

what is the role of the third T in the first line?

template<typename... T> void f(T (* ...T)(int, int);
^
|
this one

If I understand the syntax correctly, after ... we should see the name
of the function parameter pack, so using T seems somehow wrong to me.

Am I missing something?

Ganesh

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Douglas Gregor
Guest





PostPosted: Mon May 21, 2007 6:06 pm    Post subject: Re: Question about 8.3/10 (function parameter pack) Reply with quote



On May 20, 8:12 pm, AlbertoBarb...@libero.it (Alberto Ganesh Barbati)
wrote:
Quote:
in 8.3/10 of the latest draft (N2289) the example contains:

You mean 8.3.5/10 of N2284, I assume?

Quote:
template<typename... T> void f(T (* ...T)(int, int);

int add(int, int);
float subtract(int, int);
void g() {
f(add, subtract);
}

what is the role of the third T in the first line?

Ah, looks like a typo. That was a lower-case 't' in the original
document. I've reported this problem to the project editor.

Thanks!

- Doug

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to top
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group