At 02:49 PM 2/18/2003, Itay Maman wrote:
>"Rodolfo Lima" <[EMAIL PROTECTED]> wrote in message
>b2tm6v$9o7$[EMAIL PROTECTED]">news:b2tm6v$9o7$[EMAIL PROTECTED]...
>> How different is boost::any from this new variant library? Don't they
>> address the same issue?
>>
>
>In short:
>
>(1) boost::any can accept a value of any possible type. boost::variant
>accepts only values of a finite set of types, which are passed as
template
>parameters
>(2) boost::any offers a query-based mechanism for accessing its held
value:
>any_cast<T>(a); This operation may fail (at runtime). The equivalent
>facility of boost::variant is: apply_visitor(a_visitor, a_variant). This
>operation will fail at *compile-time* if a_visitor is not a valid visitor
>for a_variant. More details can about visitation can be found in
variant's
>docs.
Note that the need to document the difference between boost::any and
boost::variant is common to both libraries.
Thus (assuming boost::variant is accepted) it would make sense to document
the difference in one place (presumably boost::variant) but then also add a
sentence with a link to the boost::any docs. Perhaps add that to your do
list:-)
--Beman
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
- [boost] Re: Re: Forma... Fernando Cacciola
- [boost] Re: Formal review or Variant L... Eric Friedman
- [boost] Re: Formal Review: Variant Library Fernando Cacciola
- [boost] Re: Formal Review: Variant Library Eric Friedman
- [boost] Re: Formal Review: Variant Lib... Fernando Cacciola
- [boost] Re: Formal Review: Variant Lib... Fernando Cacciola
- Re: [boost] Formal Review: Variant Library Fernando Cacciola \(Home\)
- Re: [boost] Formal Review: Variant Library Anthony Williams
- [boost] Re: Formal Review: Variant Library Rodolfo Lima
- [boost] Re: Formal Review: Variant Library Itay Maman
- [boost] Re: Re: Formal Review: Variant... Beman Dawes
- [boost] Re: Re: Formal Review: Var... Itay Maman
