|
-
February 15th, 2012, 07:47 AM
#11
Re: Pair<> with 3 elements?
 Originally Posted by superbonzo;n3242
For simple function names, argument dependent lookup (3.4.2) applies even when the function name is not visible within the scope of the call. This is because the call still has the syntactic form of a function call (3.4.1). But when a function template with explicit template arguments is used, the call does not have the correct syntactic form unless there is a function template with that name visible at the point of the call. If no such name is visible, the call is not syntactically well-formed and argument-dependent lookup does not apply. If some such name is visible, argument dependent lookup applies and additional function templates may be found in other namespaces.
I see, but what exactly does "unless there is a function template with that name visible at the point of the call" mean?
If I get this correctly, it means you can add "using std::get", at which point, ADP would activate? Which would further mean that if I wrote a md::tuple, then it would call my md::set because I declared using std::set?
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|