Custom build of libc++ for OS X 10.6-10.7 already has C++17 as_const. Add workaround for Apple Clang has strange issues (freeze and segfault).