Boost logo

Boost :

Subject: Re: [boost] Heterogeneous Container Library (HCL) Feedback and Testing
From: Evgeny Panasyuk (evgeny.panasyuk_at_[hidden])
Date: 2015-06-03 18:48:19


03.06.2015 23:42, Andrzej Krzemienski:
> Could you provide some sketch of a real life scenario? The examples show
> how I can use it, but I fail to imagine why I would need it. You mentioned
> storing the results of various DB queries, how would you make use of data
> stored in such way?

For example, It can be used as fast drop-in replacement for
std::vector<boost::variant<Types...>> in case when order of elements
(across different types) is not important.
For instance CAD application may want to process all objects, like draw
all of them or apply some filter or serialize. There is no need to pay
cost of dynamic dispatch on each element.

By the way,
https://akrzemi1.wordpress.com/2013/12/11/type-erasure-part-iii/#comment-1752

Best Regards,
Evgeny Panasyuk


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