首页> 外文OA文献 >Designing expression templates with concepts
【2h】

Designing expression templates with concepts

机译:使用概念设计表达式模板

代理获取
本网站仅为用户提供外文OA文献查询和代理获取服务,本网站没有原文。下单后我们将采用程序或人工为您竭诚获取高质量的原文,但由于OA文献来源多样且变更频繁,仍可能出现获取不到、文献不完整或与标题不符等情况,如果获取不到我们将提供退款服务。请知悉。

摘要

Concepts are likely to be introduced in a future C++ standard. They can be used for constraining template parameters, which enables checking requirements on template parameters sooner in the compilation process, and thus providing more intelligible error messages to the user.They can also be used in the specialization of templates, thus leading to a better control over the selection of the most appropriate version of a template for a given instantiation. This latter aspect offers new possibilities in the design of template libraries, as it enhances the specialization mechanism of templates, and set it up as a solid alternative to inheritance when static binding can replace dynamic binding.This report addresses the design of expression templates (i.e. templates that represent expressions and are usually built through operator overloading) that are useful to develop an embedded domain specific language (EDSL), and can speed up the evaluation of an expression by delaying the evaluation of intermediate operations to avoid unnecessary temporary objects.We propose to use concept-based template specialization to parse expression templates in order to ease the design of an EDSL. This approach is a static variant of the well-known visitor design pattern that replaces the overridden methods in the double dispatch of the original design pattern by template specializations based on concepts. An example of EDSL for linear programming developed with our solution demonstrates that a concept-based design helps producing concise and reliable code.
机译:概念很可能会在未来的C出台++标准。它们可以用于约束模板参数,使检查模板参数要求越早在编译过程中,从而提供更多的理解错误信息到user.They也可以在模板的专业化使用,这样就导致了更好的控制以上的模板对于给定的实例最合适的版本选择。后一方面中的模板库的设计提供了新的可能性,因为它增强了模板的专业化机制,将其设置为一个坚实的替代继承时,静态绑定可以替代动态binding.This报告涉及的表情模板的设计(即表示表达式和通常是通过操作符重载内置是有用模板)来开发一个嵌入式域专用语言(EDSL),并且可以通过延迟的中间操作的评价,以避免不必要的临时objects.We提出加快表达式的评估在使用概念为基础的模板特解析表达式模板,以纾缓EDSL的设计。这种方法是替换基于概念的模板特原有的设计模式的双重派遣覆盖的方法知名的游客设计模式的静态变量。对于我们的解决方案开发的线性规划EDSL的例子表明,基于概念的设计有助于制作简明和可靠的代码。

著录项

  • 作者

    Bruno Bachelet; Loïc Yon;

  • 作者单位
  • 年度 2017
  • 总页数
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类

相似文献

  • 外文文献
  • 中文文献
  • 专利
代理获取

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号