参数依赖查找 [英] argument dependent lookup

查看:67
本文介绍了参数依赖查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单程序:


#include< iostream>

int main(){

std :: cout< ;< " bleee" << endl;

}


VC ++ .NET 2003和GCC(我认为3.3)告诉我endl是未定义的

identivier。这是正确的,还是应该通过ADL可见?


谢谢,

马丁

simple program:

#include <iostream>
int main() {
std::cout << "bleee" << endl;
}

both VC++.NET 2003 and GCC (3.3 i think) tell me that endl is an undefined
identivier. is that correct, or should endl be visible through ADL?

thanks,
martin

推荐答案

* Martin Vorbrodt:
* Martin Vorbrodt:
简单程序:

#include< iostream>
int main(){
标准: :cout<< " bleee" << endl;
}



VC ++ .NET 2003和GCC(我认为3.3)告诉我endl是一个未定义的
标识符。这是正确的,还是应该通过ADL可见?
simple program:

#include <iostream>
int main() {
std::cout << "bleee" << endl;
}

both VC++.NET 2003 and GCC (3.3 i think) tell me that endl is an undefined
identivier. is that correct, or should endl be visible through ADL?




有趣,我不知道。


基准:也无法使用Comeau在线编译,也使用< ostream>包含。


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么这是一件坏事吗?

A:热门发布。

问:usenet和电子邮件中最烦人的是什么?



Interesting, and I don''t know.

Datum: fails to compile also with Comeau online, also with <ostream> included.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?




Martin Vorbrodt写道:

Martin Vorbrodt wrote:
简单程序:

#include< iostream>
int main(){
std :: cout<< " bleee" << endl;
}



VC ++ .NET 2003和GCC(我认为3.3)告诉我endl是一个未定义的
标识符。这是正确的,还是应该通过ADL可见?

谢谢,
马丁
simple program:

#include <iostream>
int main() {
std::cout << "bleee" << endl;
}

both VC++.NET 2003 and GCC (3.3 i think) tell me that endl is an undefined
identivier. is that correct, or should endl be visible through ADL?

thanks,
martin




我很确定是正确的。在endl的

情况下重载的操作符调用是一个成员函数,所以ADL不应该适用。



I''m pretty sure that is correct. The overloaded operator call in the
case of endl is a member function, so ADL shouldn''t apply.




" Martin Vorbrodt" < MV ******* @ poczta.onet.pl>在消息中写道

news:dj ********** @ news.onet.pl ...

"Martin Vorbrodt" <mv*******@poczta.onet.pl> wrote in message
news:dj**********@news.onet.pl...
简单程序:

#include< iostream>
int main(){
std :: cout<< " bleee" << endl;
}



VC ++ .NET 2003和GCC(我认为3.3)告诉我endl是一个未定义的
标识符。这是正确的,还是应该通过ADL可见?

谢谢,
马丁
simple program:

#include <iostream>
int main() {
std::cout << "bleee" << endl;
}

both VC++.NET 2003 and GCC (3.3 i think) tell me that endl is an undefined
identivier. is that correct, or should endl be visible through ADL?

thanks,
martin




写的时候std ::在cout前面,你可能会错过

前面的endl?


; o)


您当然可以使用命名空间std来执行整个命名空间而不是
.


在顶部。< br $>

祝你好运,

Mogens



When you write std:: in front of cout, what could you possibly be missing in
front of endl?

;o)

You could of course bring in the whole namespace instead by doing a

using namespace std;

at the top.

Best regards,
Mogens


这篇关于参数依赖查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆