Boost logo

Boost Users :

Subject: Re: [Boost-users] boost any questions and praise
From: Alan Tennant (alan2here_at_[hidden])
Date: 2010-02-04 12:54:07


Why is the member "content" private in any? I tried to make it public but I
actually couldn't find it in the .h file.

On 4 February 2010 10:36, Alan Tennant <alan2here_at_[hidden]> wrote:

> The syntax is more like this:
>>
>> poly<ostreamable> p;
>> p = 42;
>> cout << p; // writes "42"
>> p = "hello";
>> cout << p; // writes "hello";
>> p = vector<int>(); // does not compile, because vector<int> is not
>> ostreamable.
>>
>> Note that you should implement ostreamable.
>>
>
> Thank you for the explanation.
>
>
> So it's not going to be safe as in "type safe" but it may well be
>>> perfectly safe.
>>
>>
>> I don't understand this.
>>
>
> As I described which is not quite how it works wouldn't be type safe as you
> could put something without a method in then call that method but it would
> be safe as like everything else in coding in it wouldn't break unless you
> did something wrong.
>
>
> polly<allMethodsAble> p1;
>
> This would be useful, but if it won't do this then it's any_stream.
>
> Contact the maintainer to find out if he wants to put the already
> implemented stream support or <...able> into any.
>



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