[libcxx-dev] How to check for a feature-test macro

Marshall Clow via libcxx-dev libcxx-dev at lists.llvm.org
Wed Dec 5 10:39:53 PST 2018


On Tue, Dec 4, 2018 at 7:34 PM Marshall Clow <mclow.lists at gmail.com> wrote:

> An alternate formulation - w/o the `IS_DEFINED` trickery.
>
> #if TEST_STD_VER > 17
> # if !defined(__cpp_lib_char8_t)
>   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
> # else
> #  if __cpp_lib_char8_t < 201811L
> #   error "__cpp_lib_char8_t has an invalid value"
> #  endif
> # endif
> #endif
>

After thinking about this overnight, I like this better than what I've got
in D55308.

-- Marshall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20181205/59bc3704/attachment.html>


More information about the libcxx-dev mailing list