<string_view> for libc++

Marshall Clow mclow.lists at gmail.com
Mon Jan 6 21:39:12 PST 2014


On Jan 6, 2014, at 7:11 PM, Arthur O'Dwyer <arthur.j.odwyer at gmail.com> wrote:

> On Mon, Jan 6, 2014 at 4:49 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
>> On Jan 6, 2014, at 2:01 PM, G M <gmisocpp at gmail.com> wrote:
>>> 
>>> 1. string_view implements it's own __min function, but this is unfortunately a macro in mingw's stdlib.h
>> 
>> Frackety frack frack.
>> I can’t use std::min () because it’s not constexpr - but it should be.
> […]
>> it needs the C++14 constexpr rules.
> 
> std::min() will be constexpr in C++14, won't it?

There is a DR filed against the C++14 draft that says std::min/max etc should be constexpr.

Hopefully that will get resolved next month in Issaquah.

> (If not, it should be. IMHO it would be reasonable to say that "proper
> std::min support" is blocking "std::string_view support”.)

Nah. It’s easy to write a std::min replacement that is constexpr (assuming that operator < is constexpr).
That’s what __min in string_view is; it just would be better if it could use std::min.

— Marshall






More information about the cfe-commits mailing list