Boost logo

Boost :

From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2022-04-16 01:32:44


On Fri, Apr 15, 2022 at 6:43 PM Ivan Matek wrote:
>
> Internally as a member, not talking about template argument.
>

Note that boost::static_string (Boost.StaticString) does not always use size_t:
https://github.com/boostorg/static_string/blob/develop/include/boost/static_string/static_string.hpp#L71-L79

    // Find the smallest width integral type that can hold a value as
large as N (Glen Fernandes)
    template<std::size_t N>
    using smallest_width =
        typename std::conditional<(N <= (std::numeric_limits<unsigned
char>::max)()), unsigned char,
        typename std::conditional<(N <= (std::numeric_limits<unsigned
short>::max)()), unsigned short,
        typename std::conditional<(N <= (std::numeric_limits<unsigned
int>::max)()), unsigned int,
        typename std::conditional<(N <= (std::numeric_limits<unsigned
long>::max)()), unsigned long,
        typename std::conditional<(N <= (std::numeric_limits<unsigned
long long>::max)()), unsigned long long,
        std::size_t>::type>::type>::type>::type>::type;

Maybe boost::beast::static_string can become an alias to boost::static_string.

Glen


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