[boost] Re: any_cast improvement
Alexander Nasonov wrote: Unai Uribarri Rodríguez wrote: Alexander Nasonov wrote: Unai Uribarri Rodríguez wrote: any_cast, as is implemented in boost 1.29, has one weakness; it doesn't allow to compile this piece of code: any x=int(5); ++any_castint(x) Boost.dynamic_any has extract functinos which work this way. But this patch adds that functionality without breaking the interface. For broken compilers it could break all because remove_reference might not work for them. If you see the compiler status page, you can see that the any test and the remove_reference works with the all compilers except Visual C++ 6 7 and SGI MIPSpro CC 7.3.1.2m. The any_test fails also with Sun Workshop 6U2. Therefore, this patch doesn't affect the portability of any. ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: any_cast improvement
Unai Uribarri Rodríguez wrote: any_cast, as is implemented in boost 1.29, has one weakness; it doesn't allow to compile this piece of code: any x=int(5); ++any_castint(x); because any_cast tries to instanciate a pointer to int. The attached patch solved this problem using boost::remove_reference from boost/type_traits.hpp. any_castT(x) will return a reference to value contained in x if its type is T, or raise bad_cast otherwise. Boost.dynamic_any has extract functinos which work this way. -- Alexander Nasonov Remove -mycop from my e-mail address for timely response ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: any_cast improvement
Alexander Nasonov wrote: Unai Uribarri Rodríguez wrote: any_cast, as is implemented in boost 1.29, has one weakness; it doesn't allow to compile this piece of code: any x=int(5); ++any_castint(x) Boost.dynamic_any has extract functinos which work this way. But this patch adds that functionality without breaking the interface. ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost