z*n
2 楼
护照公证需要填表吗?还是公证员直接在护照复印件上敲戳签名就行了?
多谢了。
多谢了。
a*t
3 楼
还是一定要找个朋友做translator?还有certification里文件名称写中文名还是英文名
称?
称?
d*n
4 楼
The output of the following piece of simple code to test stl map is very
weird.
//-------------------code-----------------------------
#include
#include
weird.
//-------------------code-----------------------------
#include
#include
M*7
5 楼
micro sd
f*u
7 楼
可以自己翻译,然后找人证明你翻译的对。
d*e
8 楼
change myMap to
map myMap;
map
d*p
10 楼
your compare function wrong.
each key in myMap is converted to a A object with index set to 0 and thus
totally disables the compareA.
change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
with 3 elements but not sure it is what u want.
each key in myMap is converted to a A object with index set to 0 and thus
totally disables the compareA.
change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
with 3 elements but not sure it is what u want.
z*e
11 楼
try to add explicit to your constructor to see the effect.
explicit A::A(string, int)
explicit A::A(string, int)
d*n
12 楼
Thanks but could you elaborate?
I don't see why the index is set to 0. When the key is converted?
【在 d****p 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: your compare function wrong.
: each key in myMap is converted to a A object with index set to 0 and thus
: totally disables the compareA.
: change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
: with 3 elements but not sure it is what u want.
I don't see why the index is set to 0. When the key is converted?
【在 d****p 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: your compare function wrong.
: each key in myMap is converted to a A object with index set to 0 and thus
: totally disables the compareA.
: change (lhs.index < rhs.index); to lhs.str < rhs.str will populate the map
: with 3 elements but not sure it is what u want.
t*t
14 楼
First of all, the key here is string. You want to compare 2 strings in your
comparator, not 2 A objects.
But you provide a comparator that accepts 2 A objects. Therefore the 2
strings are converted to 2 A objects, with index set to 0 (you provided
default value). So any 2 strings are always equal.
You need to clear up your concepts. It's totally a mess.
【在 d*******n 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: Thanks but could you elaborate?
: I don't see why the index is set to 0. When the key is converted?
comparator, not 2 A objects.
But you provide a comparator that accepts 2 A objects. Therefore the 2
strings are converted to 2 A objects, with index set to 0 (you provided
default value). So any 2 strings are always equal.
You need to clear up your concepts. It's totally a mess.
【在 d*******n 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: Thanks but could you elaborate?
: I don't see why the index is set to 0. When the key is converted?
d*n
15 楼
I see......
I did mess up the logic.
So unless you want to use a self-defined or some weird thing as key, you
probably don't need to define the comparator.
your
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: First of all, the key here is string. You want to compare 2 strings in your
: comparator, not 2 A objects.
: But you provide a comparator that accepts 2 A objects. Therefore the 2
: strings are converted to 2 A objects, with index set to 0 (you provided
: default value). So any 2 strings are always equal.
: You need to clear up your concepts. It's totally a mess.
I did mess up the logic.
So unless you want to use a self-defined or some weird thing as key, you
probably don't need to define the comparator.
your
【在 t****t 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: First of all, the key here is string. You want to compare 2 strings in your
: comparator, not 2 A objects.
: But you provide a comparator that accepts 2 A objects. Therefore the 2
: strings are converted to 2 A objects, with index set to 0 (you provided
: default value). So any 2 strings are always equal.
: You need to clear up your concepts. It's totally a mess.
t*t
16 楼
exactly -- looks like you are comparing the integer, so why not use the
integer as index? even better, use an array?
【在 d*******n 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: I see......
: I did mess up the logic.
: So unless you want to use a self-defined or some weird thing as key, you
: probably don't need to define the comparator.
:
: your
integer as index? even better, use an array?
【在 d*******n 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: I see......
: I did mess up the logic.
: So unless you want to use a self-defined or some weird thing as key, you
: probably don't need to define the comparator.
:
: your
d*n
17 楼
here I am doing trying out some tests,
but to your question, key should be chosen by the nature of the problem not
the nature of the data-structure, right? that is, most likely you don't have
the freedom to choose what to be the key.
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: exactly -- looks like you are comparing the integer, so why not use the
: integer as index? even better, use an array?
but to your question, key should be chosen by the nature of the problem not
the nature of the data-structure, right? that is, most likely you don't have
the freedom to choose what to be the key.
【在 t****t 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: exactly -- looks like you are comparing the integer, so why not use the
: integer as index? even better, use an array?
t*t
18 楼
exactly, you select the best data structure for your problem. you seem to
want to use the integer as the key since you compared it -- then you should
use array.
so make up your mind: what do you want to use as key? the string, use map<
string, int> or map; the index, use map or multimap<
int, string> or vector or string[].
you still need to clear up your concepts. it's still a mess.
not
have
【在 d*******n 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: here I am doing trying out some tests,
: but to your question, key should be chosen by the nature of the problem not
: the nature of the data-structure, right? that is, most likely you don't have
: the freedom to choose what to be the key.
want to use the integer as the key since you compared it -- then you should
use array.
so make up your mind: what do you want to use as key? the string, use map<
string, int> or map
int, string> or vector
you still need to clear up your concepts. it's still a mess.
not
have
【在 d*******n 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: here I am doing trying out some tests,
: but to your question, key should be chosen by the nature of the problem not
: the nature of the data-structure, right? that is, most likely you don't have
: the freedom to choose what to be the key.
d*n
19 楼
map is what I need and the string is used like a name (i.e. key).
The reason I was comparing index was because I though the map needs a
comparator for the value (class A), so I simply gave it one based on
comparing index, which is not really needed. This turned out to be a
misunderstanding that messed the logic up.
Other than that, nothing is messed up.
should
multimap<
【在 t****t 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: exactly, you select the best data structure for your problem. you seem to
: want to use the integer as the key since you compared it -- then you should
: use array.
: so make up your mind: what do you want to use as key? the string, use map<
: string, int> or map; the index, use map or multimap<
: int, string> or vector or string[].
: you still need to clear up your concepts. it's still a mess.
:
: not
: have
The reason I was comparing index was because I though the map needs a
comparator for the value (class A), so I simply gave it one based on
comparing index, which is not really needed. This turned out to be a
misunderstanding that messed the logic up.
Other than that, nothing is messed up.
should
multimap<
【在 t****t 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: exactly, you select the best data structure for your problem. you seem to
: want to use the integer as the key since you compared it -- then you should
: use array.
: so make up your mind: what do you want to use as key? the string, use map<
: string, int> or map
: int, string> or vector
: you still need to clear up your concepts. it's still a mess.
:
: not
: have
相关阅读
大家讨论一下C++模板吧 (转载)实时应用在IOS, Android上那一个容易实现看来以后要把春运买票网设计当做面试考题了再给魏老师的方案打个补丁goodbug吃数据库应用开发饭的,根本不懂UI,牛逼吹得最大回goodbug,关于DC的failover策略,兼普及基础知识通过PRP这个课程大牛们给说说node.js的特点吧?周末上点有用的信息古德巴大牛,请看这个设计题真正有货的,没有骂人的异步编程+FP的程序的可读性太差node太牛逼了,这次把Scala也给干了微软就是毁在愚蠢的PGM上面了很多东东要是我来设计,会很不一样用如下的framework开发手机游戏可行么Quora这个公司怎么样昨天去参加某个big data的seminar魏老师要求谁质疑谁举证Re: 大家都是怎么总结面试失利原因的?。。 (转载)