Boost logo

Boost :

Subject: Re: [boost] Static constexpr map
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2016-01-14 20:26:33


Why not:

    { "sunday"_literal, weekday::sunday },
    { "monday"_literal, weekday::monday },
    { "tuesday"_literal, weekday::tuesday },
    { "wednesday"_literal, weekday::wednesday },
    { "thursday"_literal, weekday::thursday },
    { "friday"_literal, weekday::friday },
    { "saturday"_literal, weekday::saturday }

Where:

    constexpr basic_literal<char> operator"" _string(const char* s,
std::size_t n)
    {
        return basic_literal<char>(s, n);
    }

Where basic_literal<T> can only be constructed via the UDL operators.

Glen

--
View this message in context: http://boost.2283326.n4.nabble.com/gsoc16-Can-I-quickly-check-if-the-below-really-is-the-best-approach-tp4682670p4682746.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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