由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 三个C syntax 弱问题
相关主题
大侠们救命, C++ operator new 问题问低级问题
从一个Embedded C++ quiz 调查看印度人的实力弱问:VS.net里面VC++工程的"Windows窗体应用程序"是什么类库?
What syntax is this?(about macro)使用asio的项目成功编译了
one question about operator deleteNested classes inside one class (C++)
基于macro的meta programming真难懂c++ size_t 一问
输入输出流,stl,api精通各需要多长时间?ask a C++ inheritance question
深情的呼唤师傅们!C++做题做不出来啦!C++ interview questions help
师傅们,C++概念题,弟子有礼了a question abou dll, 3x!!
相关话题的讨论汇总
话题: pair话题: foo话题: int话题: c++话题: decl
进入Programming版参与讨论
1 (共1页)
k**n
发帖数: 20
1
应该都是基本语法了
第一个,
#include
using std::cout;
using std::endl;
class Foo {};
class Bar{
public:
operator Foo() { //<- 这是什么?重载()不是这样的吧
return Foo(); //还有这个?
}
};
int main (int argc, char * const argv[]) {
...............
...................
}
第二个, preprocessor:
#define pair_type(t,u) struct pair##_t##_u //为什么要_t,_u?( 和pair##t##u 有什么不同?)(好像两种都能run)
#define pair_decl(t,u) pair_type(t,u) { \
t first; \
u second; \
}
pair_decl(int,int); //展开是什么?struct pairintint {int
k**n
发帖数: 20
2
I got the second one. Sorry for my stupidity.
Anyone can help me on the other two?

【在 k**n 的大作中提到】
: 应该都是基本语法了
: 第一个,
: #include
: using std::cout;
: using std::endl;
: class Foo {};
: class Bar{
: public:
: operator Foo() { //<- 这是什么?重载()不是这样的吧
: return Foo(); //还有这个?

S*****n
发帖数: 227
3

C++ conversion function.. google or whatever to find the meaning.

【在 k**n 的大作中提到】
: 应该都是基本语法了
: 第一个,
: #include
: using std::cout;
: using std::endl;
: class Foo {};
: class Bar{
: public:
: operator Foo() { //<- 这是什么?重载()不是这样的吧
: return Foo(); //还有这个?

c********e
发帖数: 383
4
the key that you could have that looks-like recursive definition is the
keyword "static"
it is semantically correct, but as to if the current C++ standards allows
it wait for the response from thrust.

【在 k**n 的大作中提到】
: 应该都是基本语法了
: 第一个,
: #include
: using std::cout;
: using std::endl;
: class Foo {};
: class Bar{
: public:
: operator Foo() { //<- 这是什么?重载()不是这样的吧
: return Foo(); //还有这个?

t****t
发帖数: 6806
5
hmm?合法的吧.

【在 c********e 的大作中提到】
: the key that you could have that looks-like recursive definition is the
: keyword "static"
: it is semantically correct, but as to if the current C++ standards allows
: it wait for the response from thrust.

c********e
发帖数: 383
6
ft...u should say like:
quoting from the standard:
"........"
it is legal/illegal

【在 t****t 的大作中提到】
: hmm?合法的吧.
t****t
发帖数: 6806
7
说得不是很明确,所以我没 quote
那就来一下
1.class不能包含自己[9.2,c8].
2.static data member应该是以前定义过的类型[9.2,c8]
3.[9.4.2]
2 The declaration of a static data member in its class definition is not
a definition and may be of an incomplete type other than cv-qualified
void. ...

【在 c********e 的大作中提到】
: ft...u should say like:
: quoting from the standard:
: "........"
: it is legal/illegal

c********e
发帖数: 383
8

~~~~~~~~~~ isnt this clear enough?

【在 t****t 的大作中提到】
: 说得不是很明确,所以我没 quote
: 那就来一下
: 1.class不能包含自己[9.2,c8].
: 2.static data member应该是以前定义过的类型[9.2,c8]
: 3.[9.4.2]
: 2 The declaration of a static data member in its class definition is not
: a definition and may be of an incomplete type other than cv-qualified
: void. ...

k**n
发帖数: 20
9
I see. Thank you all.
crystalike and thrust, what's [9.*] for? is it the document of ANSI c++?
where to find it?
t****t
发帖数: 6806
10
iso c++.
i use a draft, but it's close enough. draft should be free online.

【在 k**n 的大作中提到】
: I see. Thank you all.
: crystalike and thrust, what's [9.*] for? is it the document of ANSI c++?
: where to find it?

1 (共1页)
进入Programming版参与讨论
相关主题
a question abou dll, 3x!!基于macro的meta programming真难懂
来几个C++测试题输入输出流,stl,api精通各需要多长时间?
[合集] 编程的习惯问题深情的呼唤师傅们!C++做题做不出来啦!
C++ 无效语句?师傅们,C++概念题,弟子有礼了
大侠们救命, C++ operator new 问题问低级问题
从一个Embedded C++ quiz 调查看印度人的实力弱问:VS.net里面VC++工程的"Windows窗体应用程序"是什么类库?
What syntax is this?(about macro)使用asio的项目成功编译了
one question about operator deleteNested classes inside one class (C++)
相关话题的讨论汇总
话题: pair话题: foo话题: int话题: c++话题: decl