G*n
2 楼
请教OOP的C++问题
一个class A里面有virtual function fun(),现在把A作为一个interface.
然后让B,C,D....继承A,并且overwrite这个virtual function.
现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
一个class A里面有virtual function fun(),现在把A作为一个interface.
然后让B,C,D....继承A,并且overwrite这个virtual function.
现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
a*s
3 楼
rt,best buy网上买他们自己的GC,每次250刀,怎么买到第三单就再也买不下去了,
有什么秘诀吗,多谢!
还是说每账户每日有limit?
另外一个household开两个bb账户的话,可以买成功吗,谢谢!
有什么秘诀吗,多谢!
还是说每账户每日有limit?
另外一个household开两个bb账户的话,可以买成功吗,谢谢!
x*i
4 楼
On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
approved. You will be notified of the decision by mail. Please check our
website at www.uscis.gov for further updates on your case, including when
the approval notice is mailed. If you do not receive the approval notice
within 30 days, please call customer service at 1-800-375-5283 for further
assistance.
pp的但从来没看见clock开始之类的,不知道怎么回事……
approved. You will be notified of the decision by mail. Please check our
website at www.uscis.gov for further updates on your case, including when
the approval notice is mailed. If you do not receive the approval notice
within 30 days, please call customer service at 1-800-375-5283 for further
assistance.
pp的但从来没看见clock开始之类的,不知道怎么回事……
H*r
5 楼
white house
p*e
6 楼
返回值的struct里包含类的名字信息就行了啊
【在 G***n 的大作中提到】
: 请教OOP的C++问题
: 一个class A里面有virtual function fun(),现在把A作为一个interface.
: 然后让B,C,D....继承A,并且overwrite这个virtual function.
: 现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
: 如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
: 哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
【在 G***n 的大作中提到】
: 请教OOP的C++问题
: 一个class A里面有virtual function fun(),现在把A作为一个interface.
: 然后让B,C,D....继承A,并且overwrite这个virtual function.
: 现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
: 如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
: 哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
a*s
7 楼
rere
u*e
8 楼
gongxi, 是批了。
s*h
9 楼
卡神环游世界到dc了.
s*s
11 楼
cong~~~~~~~~
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
s*t
14 楼
big cong!!!
v*9
16 楼
可以不需要typeid,不过就比较奇怪一点。
tester.h
================
class A{
public:
virtual void invoke();
};
class B:public A{
public:
void virtual invoke();
};
class C:public A{
public:
void invoke();
};
class D:public A{
public:
void invoke();
};
=====================
main.cpp
=====================
#include
#include
#include "tester.h"
using namespace std;
void test(A* a){
cout<};
void test(B* a){
cout<};
void test(C* a){
cout<};
void test(D* a){
cout<};
void A::invoke(){
cout<test(this);
}
void B::invoke(){
cout<test(this);
}
void C::invoke() {
cout<test(this);
}
void D::invoke() {
cout<test(this);
}
int main(int argc, const char * argv[])
{
vector vec;
B b;
C c;
D d;
vec.push_back(&b);
vec.push_back(&c);
vec.push_back(&d);
for(auto obj: vec){
obj->invoke();
}
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
======================
tester.h
================
class A{
public:
virtual void invoke();
};
class B:public A{
public:
void virtual invoke();
};
class C:public A{
public:
void invoke();
};
class D:public A{
public:
void invoke();
};
=====================
main.cpp
=====================
#include
#include
#include "tester.h"
using namespace std;
void test(A* a){
cout<};
void test(B* a){
cout<};
void test(C* a){
cout<};
void test(D* a){
cout<};
void A::invoke(){
cout<test(this);
}
void B::invoke(){
cout<test(this);
}
void C::invoke() {
cout<test(this);
}
void D::invoke() {
cout<test(this);
}
int main(int argc, const char * argv[])
{
vector vec;
B b;
C c;
D d;
vec.push_back(&b);
vec.push_back(&c);
vec.push_back(&d);
for(auto obj: vec){
obj->invoke();
}
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
======================
V*A
17 楼
gxgx!
big bless!
big bless!
s*n
19 楼
这个设计听起来不怎么oop,为什么要知道type,能抽象出来吗
【在 G***n 的大作中提到】
: 请教OOP的C++问题
: 一个class A里面有virtual function fun(),现在把A作为一个interface.
: 然后让B,C,D....继承A,并且overwrite这个virtual function.
: 现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
: 如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
: 哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
【在 G***n 的大作中提到】
: 请教OOP的C++问题
: 一个class A里面有virtual function fun(),现在把A作为一个interface.
: 然后让B,C,D....继承A,并且overwrite这个virtual function.
: 现在有一个数组是vector,当然vector里面可能是B,C,D,...任意一个class。
: 如果要做一个循环处理这个vector,如何知道vector里的每一个element是B,C,D中的
: 哪一个呢?因为要处理fun()的返回值,想知道每个element是哪个class。
m*n
20 楼
big cong!!!
z*f
21 楼
http://www.dc495.com/wiki/index.php?title=Visiting_DC
【在 z***f 的大作中提到】
: dc495.com ... haha
【在 z***f 的大作中提到】
: dc495.com ... haha
s*7
22 楼
gxgx!
S*t
24 楼
CONG, BAOZI
l*7
26 楼
恭喜,吃包子
k*r
27 楼
good good. thx~
【在 z***f 的大作中提到】
: http://www.dc495.com/wiki/index.php?title=Visiting_DC
【在 z***f 的大作中提到】
: http://www.dc495.com/wiki/index.php?title=Visiting_DC
e*p
28 楼
Big cong!
S*y
30 楼
恭喜
L*n
32 楼
恭喜, 求背景
j*1
33 楼
Capitol
白宫要提前半年预约吧
白宫要提前半年预约吧
i*n
34 楼
cong.
baozi
baozi
w*e
36 楼
cong!
d*i
37 楼
搭车问,现在白宫对外开放么?可以提前申请么?
S*n
38 楼
cong!
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
s*i
40 楼
cong!
l*n
42 楼
congrats, 包子
s*s
44 楼
cong!
c*4
45 楼
来华盛顿州玩了又去华盛顿首府,好羡慕。上次没有去拜访梦老让请吃大餐?
l*4
46 楼
Big cong!
L*S
48 楼
gxgx
k*g
49 楼
BIG CONG!
n*g
50 楼
big con
m*5
51 楼
Cong~~~~~~~
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
gv
52 楼
gxgx
H*1
53 楼
批了。恭喜
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
s*u
54 楼
cong!!
p*y
55 楼
来学习的,也恭喜楼主阿
a*n
56 楼
gx
n*y
57 楼
Cong~
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
E*A
58 楼
恭喜
c*t
59 楼
gongxi
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
b*j
60 楼
cong~~
s*8
61 楼
Big cong
★ 发自iPhone App: ChineseWeb 7.5
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
★ 发自iPhone App: ChineseWeb 7.5
【在 x***i 的大作中提到】
: On February 15, 2013, your I140, IMMIGRANT PETITION FOR ALIEN WORKER was
: approved. You will be notified of the decision by mail. Please check our
: website at www.uscis.gov for further updates on your case, including when
: the approval notice is mailed. If you do not receive the approval notice
: within 30 days, please call customer service at 1-800-375-5283 for further
: assistance.
: pp的但从来没看见clock开始之类的,不知道怎么回事……
A*n
62 楼
cong
c*6
63 楼
gxgx
C*d
64 楼
gxgx!
k*r
65 楼
cong!
f*s
66 楼
cong
g*u
67 楼
恭喜
d*7
68 楼
great news, Congrat
y*o
69 楼
恭喜
l*s
70 楼
gxgx
b*e
71 楼
恭喜恭喜,包子~~~
x*i
72 楼
不好意思,散尽家财过一次,包子没了
t*m
74 楼
大大恭喜!谢谢分享tips,很有用!
d*7
75 楼
半绿了,恭喜恭喜!
T*8
76 楼
恭喜!
b*j
77 楼
big cong!!!
v*o
78 楼
gx!
k*g
79 楼
BIG CONG!
相关阅读
求机器学习或者计算机视觉的审稿机会纠结的Case,请教大家NSC-EB1B要不要PPPERM申请公司刚刚雷人体检rfe交了后一般要多久有消息啊Eb1a, TSC, pp approved, w/ WeGreened, 求IVP指导eb1a TSC 周一追加pp 求祝福【2017年1月第86, 87绿】TSC EB1B 2015/08/05 RD485 的Priority Date 一问EB1A NSC 2016.05 RD 2017.01 AD有关J1申请绿卡:tsc 16年7月的485求祝福求助:EB1B I-140 petition的Cover letter有错, 该怎么办刚看到我前面三个485的号approved了推荐信必须是physical mail吗?【2017年1月第81, 82绿】TSC 2月25号rd双重国籍有什么坏处吗?USPS priority mail用啥地址?绿卡收到两年后,另一份140批了,咋办?485体检没有做尿检除了等RFE补上还有没有办法提前补呢?EB1 文章要全部打印吗