in_constexpr:一种在constexpr函数内部进行运行时检测的方法

时间:2021-05-01 09:17:38
【文件属性】:
文件名称:in_constexpr:一种在constexpr函数内部进行运行时检测的方法
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-01 09:17:38
constexpr constexpr-context if-constexpr constexpr-runtime-detection C++ 关于in_constexpr 一种检测constexpr函数中是否在constexpr上下文中的方法。 通过能够检测是否在constexpr上下文中,我们可以选择实现特定于运行时的算法,同时在编译时可以使用不同的算法来执行某些操作。 该方法将在讨论 特征 if(in_constexpr()/ in_runtime())-能够检测运行时还是编译时 smart_assert-constexpr友好的断言 约束条件 仅在GCC 5+和Clang 3.8+上测试 到目前为止只有x86 运行时方法仅在Linux上有效(暂时替换二进制文件中的代码应在Windows下运行) 查看有关警告的详细说明 该库必须静态链接 初始化逻辑依赖于能够修改程序的.text段 使用图书馆 建造和安装 您可以使用cmake编译并安装此库。 您将需要将此库链接为静态库。 您可以使用以下方法自定义和安装该库: cm
【文件预览】:
in_constexpr-master
----.clang-format(711B)
----.gitignore(5B)
----src()
--------if_in_constexpr.cpp(2KB)
----LICENSE_1_0.txt(1KB)
----examples()
--------some_transform.cpp(725B)
--------factorial.cpp(1KB)
--------CMakeLists.txt(237B)
----README.md(3KB)
----include()
--------in_constexpr()
----CMakeLists.txt(2KB)

网友评论