首页> 外文会议>International Conference on Objects, Models, Components, Patterns >Fake Run-Time Selection of Template Arguments in C++
【24h】

Fake Run-Time Selection of Template Arguments in C++

机译:在C ++中假的运行时选择模板参数

获取原文

摘要

C++ does not support run-time resolution of template type arguments. To circumvent this restriction, we can instantiate a template for all possible combinations of type arguments at compile time and then select the proper instance at run time by evaluation of some provided conditions. However, for templates with multiple type parameters such a solution may easily result in a branching code bloat. We present a template metaprogramming algorithm called for_id that allows the user to select the proper template instance at run time with theoretical minimum sustained complexity of the branching code.
机译:C ++不支持模板类型参数的运行时分辨率。为了规避此限制,我们可以将模板实例化,以便在编译时进行所有可能的参数的组合,然后通过评估一些提供的条件来在运行时选择正确的实例。但是,对于具有多种类型参数的模板,这样的解决方案可能很容易导致分支代码膨胀。我们介绍了一个名为for_id的模板成分标记算法,该算法允许用户在运行时选择正确的模板实例,其具有分支代码的理论最小持续复杂度。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号