d****p 发帖数: 685 | 1 reference is
1. a pointer
2. a pointer to a valid object
3. a pointer which is always associated with the valid object it points to
When you try to reseat a reference, you are breaking rule 3. If you want sth
that could be reseatable, use a
pointer.
Syntactically a reference is "reseated" since you are actually assigning the
new object to the object the
reference was originally bound to. In your case, ref = v2 is actually v1 =
v2
reference is a concept manipulated by compiler. Its physical prese... 阅读全帖 |
|
p*u 发帖数: 2454 | 2 I know a reference in C++ cannot be reseated; am just trying to test
this concept. But it seems to me that as long as u wish to implement an
assignment operator u will not get a "reference reseating" compiler
error, it will just copy value of second object to first object. How can
I have a true compiler error?
Sample code:
"
#include
#include
int main()
{
std::vector v1( 10, 1 );
std::vector v2( 20, 2 );
std::vector& ref = v1;
for( int i = 0; i < re... 阅读全帖 |
|
X****r 发帖数: 3557 | 3 I never heard of this "reference reseating" compiler error. AFAIK
there is just no syntax to tell the compiler that you want to reseat
a reference. |
|
p*u 发帖数: 2454 | 4
then where does this "reference reseating" come from? in another word, why
should people know u cannot reseat a reference when u can't do such a
thing? |
|
X****r 发帖数: 3557 | 5 I'm not the one who raised this question so I have no idea where this
"reference reseating" come from. In fact, this is the first time I
ever hear of this term.
why |
|
b********n 发帖数: 609 | 6 "a reference cannot be reseated"是指当ref指向v1之后,你只能通过它来对v1进行操
作,而不能通过"ref=v2"之后对v2进行操作,ref=v2就是copy。
实际上你是没有办法写code来命令ref指向v2,然后指望编译器报错的。 |
|
b********n 发帖数: 609 | 7 看来你很懂啊,看看这段code,算不算reseating:
“
object& operator=( const object& rhs )
{
if ( this != &rhs )
{
this->~object();
new ( this ) object( rhs );
}
return *this;
}
”
sth
the |
|
X****r 发帖数: 3557 | 8 What are you talking about? You cannot 'reseat' a reference
in C++.
Since pAnimal is referring to the cCat object,
pAnimal = cDog; calls the default implemented operator =
that copies m_strName from cDog to cCat. |
|
t****t 发帖数: 6806 | 9 啥叫错误? 你要对reference(指向的对象)赋值, 这是个合理的操作啊. 编译器怎么知
道你想要reseat? |
|
c*****g 发帖数: 119 | 10 it's not a reseat, but an assignment.
you can check what happens to b after you "reseating" ref_1 by c.
any |
|
N3 发帖数: 126 | 11 把总裁炒了,然后西方要求把总裁再重新reseat
那个总裁是英国白人 |
|
|
d*******u 发帖数: 186 | 13 Reference:
1. An alias for an object;
2. must be initialized when it is defined.
3. The reference can not be reseated.
Pointer is much more flexible. |
|
t****t 发帖数: 6806 | 14
abi=application binary interface, 最主要的是决定函数怎么调用, 还有name
mangling, exception的处理
api还用说么.
stack unwind until caught, or until another exception (terminate())
unexpected()
EDIT:搞混了, 是terminate(). unexpected发生在扔出说明里没有的异常时.
const, reference, parent class w/o default ctor
reference can not be reseated, can not have nullptr value
suspect
这个太泛泛了, 必须得有点背景才行吧. 比如说看/proc/pid里的东西, 但是看什么就
很难说了. |
|
v****x 发帖数: 980 | 15 你可以找个附近的plumber问一下价,叫reseat toilet,换垫圈,拧螺丝,plumber都
挺贵,几十近百刀一个,不修也无所谓,买了说不定要换新型马桶。
contractor |
|
O***C 发帖数: 1219 | 16 I bought my laptop 3.5 years ago. It is Dell INSPIRON E 1505. The system is
Windows XP Media Center 2002.
Recently, when I restart the computer, it always shows:
The AC power adapter type cannot be determined. This will prevent optimal
system performance.
To resolve this issue, try to reseat the power adapter.
I unplug and re-connect the power adapter and restart the computer. The same
information comes out.
I choice to skip it and the laptop is working fine right now.
Any one what is the proble |
|
m***T 发帖数: 11058 | 17 是一个jumper。简单地儿说就是有三、四个针,一个套儿平时联结其中的两个,需要
reset的时候放到另外的联结上。要看你的主板是谁家的啥型号。
还有一个相对简单的办法就是把显卡、内存等一一地等拔下来reseat,有些时候就是因
为接触不良导致的。如果再不行再找其它的问题。 |
|
i*********5 发帖数: 19210 | 18 http://triathlon.competitor.com/2013/11/gear-tech/5-causes-of-a
Q: I keep getting flat tire after flat tire and I can’t really figure out
why. Is it just bad luck or is there something wrong with my tire?
A: It’s possible that you keep getting punctures from new sharp things
poking through the tire, but that’s unlikely. There’s probably something
wrong with your tire, wheel or the way you are putting a new tube into the
tire. These are the things that could be causing your recurring flats and
h... 阅读全帖 |
|
t******g 发帖数: 10390 | 19 here is a report from 2010
http://www.boltsfromtheblue.com/2010/3/23/1387708/stadium-thoug
During the 1997 expansion, no structural upgrades were made to the existing
portions of the stadium, nor did the expansion address back-of-house issues.
As noted during several stadium tours, serious cracks were present
throughout the stadium; exposed rebar is rusting; poor seepage causes water
settlement; and during rainy weather, fans must be reseated in other areas.
Deteriorated expansion joints allow w... 阅读全帖 |
|
n********t 发帖数: 1079 | 20 因为EXIT ROW有一些义务,如果腿不好可能FA会给重新安排座位,那时你无法控制被换到
哪里,有时不懂英文也会是RESEAT的原因. |
|
J*******i 发帖数: 3430 | 21 16是bulkhead,腿还是伸不舒服
32是ER 不会英语不能坐,就算坐上去了空服起飞前让他们verbal response的时候还
是会给reseat的 |
|
f********p 发帖数: 8584 | 22 呵呵,我来给你解决,充电器reseat,就是把充电器插头那段逆时针拧开,再顺时针拧
紧,试试应该就好了。我也遇到同样的问题,打电话给HP,就这样解决了。 |
|
l*********8 发帖数: 1313 | 23 tried to reset cmos? take out battery on motherboard then put it back.
Reseat your memory.内存很少坏. |
|
O***C 发帖数: 1219 | 24 I bought my laptop 3.5 years ago. It is Dell INSPIRON E 1505. The system is
Windows XP Media Center 2002.
Recently, when I restart the computer, it always shows:
The AC power adapter type cannot be determined. This will prevent optimal
system performance.
To resolve this issue, try to reseat the power adapter.
I unplug and re-connect the power adapter and restart the computer. The same
information comes out.
I choice to skip it and the laptop is working fine right now.
Any one what is the proble |
|
N****w 发帖数: 21578 | 25 remove kbd,mouse,hd,
reseat ram,
try again |
|
b****M 发帖数: 1390 | 26 My labtop Compaq nc 8230 can not start. When power on, it showed"F10 ROM
based set up,F12 Network service Boot", Press F10-Entering set up after a
few minutes, it showed" Drivelock Multibay password".
I have remove power battery, remove real time battery, remove DVD driver and
reseat, however, the problem can not be fixed. The hard disk is good. I
used a new hard drive to start the notebook, the same message. Any
suggestions? thanks in advance! |
|
s********z 发帖数: 5411 | 27 I put this computer together almost a year ago and it's been working
well. I typically leave the computer on overnight, a couple of weeks
ago, I came in one day in the morning and the computer was off and it
would not boot up.
Basically, when I try to boot it up, it will turn on and stop at the
debug code "89"(LCD on motherboard) for 25 seconds and then try to reboot
again. It repeats the process. It can not even get into the BIOS.
I tried to reseat the CPU, reset the CMOS, boot with less ... 阅读全帖 |
|
z*********e 发帖数: 10149 | 28 0. 24pin atx和8pin/4pin 12V,这个已经检查了就应该没问题了
1. 检查内存,看看装好没有
2. reseat cpu |
|
z*********e 发帖数: 10149 | 29 you can try to reseat your cpu, that works sometimes |
|
a*o 发帖数: 19981 | 30 reseat不行?那很有可能这个CPU是脑子缺根弦,RMA吧。 |
|
i**p 发帖数: 902 | 31 I can reseat a reference by the following code and g++ does not generate any
error.
base& ref_1 = b;
ref_1 = c; |
|
|
|
k******r 发帖数: 2300 | 34 You can call yourself John today and Mike tomorrow and Jack next month. No
matter how many names you call yourself, you are nobody but yourself. Nobody
will blame you you have so many names(at least legally you are fine). The
same moral philosophy applies here. The compiler won't complain a variable
has so many nick names(namely alias) because a variable is not identified by
name. |
|
d****p 发帖数: 685 | 35 I like this explanation :-)
And one more thing to add up, John is always YOUR name even you have new
fancier new names and have
forgot your first name as John - John is loyal and always belongs to you.
Once you had it, you will always have
it. That's so cool.
Nobody
by |
|
G****A 发帖数: 4160 | 36 cited from C++ faq
"Unlike a pointer, once a reference is bound to an object, it can not be
reseated to another object.
....
In that sense, a reference is similar to a const pointer such as int*
const p."
我怎么觉得不对呢,还是我理解错了? |
|
d**d 发帖数: 389 | 37 $ g++ --version
g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
code 如下:
#include
using namespace std;
class Animal
{
protected:
string m_strName;
Animal(string strName):m_strName(strName)
{
};
public:
string GetName(){return m_strName;};
virtual const char* Speak(){return "???";};
};
class Cat:public Animal
{
public:
Cat(string strName): Animal(strName)
{
}
virtual const char *Speak(){return "Meow";};
};
clas... 阅读全帖 |
|
d**d 发帖数: 389 | 38 我的意思是说gcc查不出这类错误? 这个错误是明显的啊。为什么他能查出来
reference在初始化的时间没有赋值? |
|
X****r 发帖数: 3557 | 39 What error? "pAnimal = cDog;" is a perfectly legal C++
statement with well-defined semantics. If you expect this
statement to do something else, it's not gcc's problem. |
|
d**d 发帖数: 389 | 40 哈哈。这个错误能过去的话,主要是因为子父类的原因的吧?
虽然Cat没有定义operator=,但是由于子父类的关系,compiler可以用default
operator=来把子类的内容复制到父类上去。要是不同类之间操作的话,编译器就报错
了。
应该给个warning啊。 |
|
a9 发帖数: 21638 | 41 这不是继承的正常使用方法吗?
这都来warning还继承干嘛呀。
么知 |
|
|
l*********s 发帖数: 5409 | 43 :-), that is what is said "now you've got the job, it is the time to really
learn some stuff" |
|
s**********8 发帖数: 131 | 44 My labtop Compaq nc 8230 can not start. When power on, it showed"F10 ROM
based set up,F12 Network service Boot", Press F10-Entering set up after a
few minutes, it showed" Drivelock Multibay password".
I have remove power battery, remove real time battery, remove DVD driver and
reseat, however, the problem can not be fixed. The hard disk is good. I
used a new hard drive to start the notebook, the same message. Any
suggestions? thanks in advance! |
|
j*********y 发帖数: 160 | 45 【 以下文字转载自 Apple 讨论区 】
发信人: jackstanley (等待黎明), 信区: Apple
标 题: NYTimes: Apple Imperfect
发信站: BBS 未名空间站 (Wed Aug 27 12:52:43 2008)
Apple Imperfect
http://bits.blogs.nytimes.com/2008/08/27/apple-imperfect/
这段很搞笑:
"...at one point Apple issued a technical note suggesting that customers
could make the machine [Note: Apple III] work by simply dropping it three
inches onto a desktop in order to reseat chips that would come loose." |
|