|
Boost : |
Subject: Re: [boost] [gsoc16] Can I quickly check if the below really is the best approach?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-01-19 06:26:18
On 19 Jan 2016 at 13:18, Gavin Lambert wrote:
> On 14/01/2016 00:57, Niall Douglas wrote:
> > 4. The primary use case example is something like this:
> >
> > // At global scope, allocates no memory whatsoever
> > static const constexpr static_map<int, const char *> map {
> > { 5, "apple" },
> > { 8, "pear" },
> > { 0, "banana" },
> > ...
> > };
>
> This seems at least superficially similar to the enum conversion library
> that was discussed briefly last year. Have you taken a look at that?
If the proposed map didn't allow value modification or indeed
non-constexpr constructible values, then they would be very similar
yes, just a different use-syntax.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk