STL headers should require C++ and forbid C · Issue #1141 · microsoft/STL · GitHub

您所在的位置:网站首页 yvals_core STL headers should require C++ and forbid C · Issue #1141 · microsoft/STL · GitHub

STL headers should require C++ and forbid C · Issue #1141 · microsoft/STL · GitHub

2022-12-27 02:11| 来源: 网络整理| 查看: 265

Mutual inclusion of xkeycheck.h yvals_core.h is intentional to ensure that xkeycheck.h has the proper value for _STL_COMPILER_PREPROCESSOR even if it's included before/without including yvals_core.h. If we don't want it to be possible to include xkeycheck.h without including yvals_core.h, we should fuse the headers.

Honestly I'd prefer to dump xkeycheck.h and request a #pragma to instruct the preprocessor to gripe at the user about keyword definitions. xkeycheck.h is a poor solution to this problem:

#include #define private public #include // Oops: we don't recheck

or

#define likely potato #include // Oops: we can't defend object-like "likely" without breaking the common function-like "likely()"

and I consequently don't think it provides good return on investment. Other STLs get by just fine without a solution for this problem - they haven't exactly been banging on our door demanding since we open-sourced ;)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3