Boost logo

Boost Users :

Subject: Re: [Boost-users] boost any questions and praise
From: Alan Tennant (alan2here_at_[hidden])
Date: 2010-01-30 20:30:18


Thanks for the info. Can it be done (at all, at the moment, elegantly,
practically, by turning a std::type_info into a type) ?

On 30 January 2010 19:58, Steven Watanabe <watanabesj_at_[hidden]> wrote:

> AMDG
>
>
> Alan Tennant wrote:
>
>> Firstly. Thank you very much team Boost, it looks like it will be very
>> useful and solve many of my coding problems.
>>
>> I can create an any
>> boost::any a1;
>>
>> I can assign something to it
>> a1 = string1;
>>
>> I can get it back out later
>> std::cout<<any_cast<std::string>(a1);
>>
>> A boost any has a "type()" method.
>>
>> However this produced an error.
>>
>> std::cout<<any_cast<a1.type()>(a1);
>>
>>
>
> Template parameters have to be types.
> The result of a1.type() is a std::type_info object.
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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