Boost logo

Boost Users :

From: Drumheller, Michael (michael.drumheller_at_[hidden])
Date: 2006-04-03 12:12:28


Robert, Oliver, and Dave:

That seems to have fixed it. I'm embarrassed for not having figured it
out.

Thank you very much.

Michael

P.S. This is totally off-topic, but I'd be a lot *less* embarrassed if
the VC compiler error messages were not so lame. This compiler has
managed to annihilate huge segments of my life with messages of the form
"Could not do the right thing with an X" instead of "Could not do the
right thing with an X; a Y was expected." In this case it should have
said
   "binary '<<': no operator found which takes a right-hand operand of
type 'double' (or there is no
    acceptable conversion to 'const double')"
Just that tiny rephrasing words would have saved a lot of pain. Alas.
Anyway: Thanks again you guys. --MD

>>> ------------------------------
>>>
>>> Message: 5
>>> Date: Mon, 3 Apr 2006 08:55:30 -0700
>>> From: "Robert Ramey" <ramey_at_[hidden]>
>>> Subject: Re: [Boost-users] Serialization--a peculiar observation
>>> regardingoperator<<
>>> To: boost-users_at_[hidden]
>>> Message-ID: <e0rghh$dua$1_at_[hidden]>
>>>
>>> hmm
>>>
>>> The operator ar << takes a reference to a const argument.
>>>
>>> It looks like the compiler is objecting to taking the
>>> reference to an argument on the stack
>>>
>>> ar << foo();
>>>
>>> which seems like a good idea to me. In this case there
>>> would be no problem, but in the case where the return of
>>> foo() would be a "tracked" type, this would break the
>>> serialization system.
>>>
>>> Robert Ramey

>>> Message: 1
>>> Date: Mon, 3 Apr 2006 10:33:55 +0200
>>> From: "David Klein" <d.klein_at_[hidden]>
>>> Subject: Re: [Boost-users] Serialization--a peculiar observation
>>> regardingoperator<<
>>> To: <boost-users_at_[hidden]>
>>> Message-ID:
>>> <D3A9DB446C206D4EA2C2CCFD637362490173A0C8_at_exchsrv.ascaron.lan>
>>> Content-Type: text/plain; charset="us-ascii"
>>>

>>> hi michael,
>>>
>>> try changing:
>>>
>>> double foo() { return 3.1416; }
>>>
>>> to
>>>
>>> const double foo() { return 3.1416; }
>>>
>>> HTH dave
>>>
>>> Message: 2
>>> Date: Mon, 3 Apr 2006 10:39:28 +0200
>>> From: "Oliver Mutz" <mutz_at_[hidden]>
>>> Subject: Re: [Boost-users] Serialization--a peculiar observation
>>> regardingoperator<<
>>> To: <boost-users_at_[hidden]>
>>> Message-ID: <001501c656fa$21bb3ed0$050aa8c0_at_[hidden]>
>>> Content-Type: text/plain; charset="us-ascii"
>>>
>>>
>>> Try changing the return type of foo() to const double.
>>> For the reason see the ratinale page in the serialization
>>> documentation.
>>>
>>> Oliver
>>>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net