Boost logo

Boost :

From: Marcin Tustin (mt_at_[hidden])
Date: 2005-06-14 04:37:16


Robert Ramey <ramey <at> rrsd.com> writes:

>
> As the library implemenation is based on templates, there is no need to
> specify all types. Any type not specifically mentioned, is checked to see
> if its a prmitive, ie int, long etc. If so, there is code to handle it.
> This is almost necessary because every platform has different types for
> things like 64 bit integers, etc.
>
> Note that std::string is special in that it is treated as a primitive. This
> is the only such special case.
>
> ar << rhs
>
> will not work for all right hand sides. If rhs is the return from a
> function call, then it is a temporary variable with only a temporary
> address. In such a case, ask yourself what ar >> rhs would mean? If rhs is
> a function call returning a reference to a const obect the above will work -
> but you might have to do some tweaking wiht ar >> rhs.

  I'm probably being dense, but what is the connection between ar >> rhs not
working because rhs is a function call, and ar << rhs where rhs is a function
call, in the case that load and save are split? If it's a temporary int on the
stack, what's the complexity?

  Also, how is the library "detecting" that I'm doing ar << foo();, and then
failing during compilation, rather than ar << x;?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk