کد مقاله کد نشریه سال انتشار مقاله انگلیسی نسخه تمام متن
434315 1441700 2013 22 صفحه PDF دانلود رایگان
عنوان انگلیسی مقاله ISI
Implementing monads for C++ template metaprograms
موضوعات مرتبط
مهندسی و علوم پایه مهندسی کامپیوتر نظریه محاسباتی و ریاضیات
پیش نمایش صفحه اول مقاله
Implementing monads for C++ template metaprograms
چکیده انگلیسی

C++ template metaprogramming is used in various application areas, such as expression templates, static interface checking, active libraries, etc. Its recognized similarities to pure functional programming languages–like Haskell–make the adoption of advanced functional techniques possible. Such a technique is using monads, programming structures representing computations. Using them actions implementing domain logic can be chained together and decorated with custom code. C++ template metaprogramming could benefit from adopting monads in situations like advanced error propagation and parser construction. In this paper we present an approach for implementing monads in C++ template metaprograms. Based on this approach we have built a monadic framework for C++ template metaprogramming. As real world examples we present a generic error propagation solution for C++ template metaprograms and a technique for building compile-time parser generators. All solutions presented in this paper are implemented and available as an open source library.


► We port Haskell typeclasses to the weakly typed C++ template metaprogramming.
► We introduce monads in C++ template metaprogramming.
► We present an approach for building a monadic framework.
► As real world examples we present an approach for simulating exceptions at compile time and simplify our compile-time parser library presented earlier.

ناشر
Database: Elsevier - ScienceDirect (ساینس دایرکت)
Journal: Science of Computer Programming - Volume 78, Issue 9, 1 September 2013, Pages 1600–1621
نویسندگان
, ,