Boost logo

Boost :

Subject: Re: [boost] Attn metaprogrammers! [Better Enums] More complete release - feedback requested
From: Anton Bachin (antonbachin_at_[hidden])
Date: 2015-06-08 21:16:45


> On Jun 8, 2015, at 20:04, Gavin Lambert <gavinl_at_[hidden]> wrote:
>
> Don't forget to measure performance. Given that enums tend to have a very low N, when I made a superficially similar static map with a runtime string index scan it turned out to be faster to just do the linear scan than to try to compute hashes or do more complex searches.

Of course :) One of the secondary reasons I gave data structures a low priority
is because I have a hunch that the benefit of more complex data structures will
be very low compared to the compilation time penalty, and will apply very rarely
in practice. It is something I plan to explore and measure, however, so I can
have a conclusive answer either way.

> (As an aside, it was quite a handy data structure. It was mainly intended for string-to-enum conversions but because of the way it was templated it could be abused to do string-to-member-pointer conversions as well, which enabled all sorts of interesting reflection scenarios.)

I am curious to know what this was, it sounds interesting.


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