C



Expression Templates

Wednesday, June 18th, 2008

Abstract: Expression Templates is a C++ technique for passing expressions as function arguments. The expression can be inlined into the function body, which results in faster and more convenient code than C-style callback functions. This technique can also be used to evaluate vector and matrix expressions in a single pass without temporaries. In preliminary benchmark [...]

Template Metaprograms

Wednesday, June 18th, 2008

The introduction of templates to C++ added a facility whereby the compiler can act as an interpreter. This makes it possible to write programs in a subset of C++ which are interpreted at compile time. Language features such as for loops and if statements can be replaced by template specialization and recursion. The first examples [...]

C++ Exception Handling

Wednesday, June 18th, 2008

Exception handling can be a very personal and complex topic. The C language gave the programmer very few exception handling capabilities, as the programmers wanted more control over exceptions themselves. Thankfully, the C++ standards committee crafted a simple, but powerful form of exception handling for the C++ language that still gives the programmer quite a [...]

Casting in C++: Bringing Safety and Smartness to Your Programs

Wednesday, June 18th, 2008

The new C++ standard is full of powerful additions to the language: templates, run-time type identification (RTTI), namespaces, and exceptions to name a few. Rather than talk about one of these “major” extensions, I will discuss one of the minor extensions: the new C++ casting operators.
Continue

Separating Interface and Implementation in C++

Wednesday, June 18th, 2008

This article discusses three related problems in the design of C++ classes and surveys five of the solutions to them found in the literature. These problems and solutions are considered together because they relate to separating the design choices that are manifested in the interface from those that are made in implementing the class. The [...]

Optimizing C++ - the WWW version

Wednesday, June 18th, 2008

Imagine that you are about to finish a relatively large program, one that has taken a few weeks or months to write and debug. Just as you are putting the finishing touches on it, you discover that it is either too slow or runs out of memory when you feed it a realistic set of [...]

More C++

Wednesday, June 18th, 2008

This document aims to provide people who have done an introductory C++ course the skills required to write bigger programs. Online versions are at http://www-h.eng.cam.ac.uk/help/tpl/languages/C++/doc/doc.html (HTML); http://www-h.eng.cam.ac.uk/help/tpl/languages/C++/doc/doc.pdf (PDF); and http://www-h.eng.cam.ac.uk/help/documentation/docsource/index.html (LaTeX).
Continue

C++ tutorial for C users

Monday, June 16th, 2008

This text enunciates and illustrates features and basic principles of C++. It is aimed at experienced C users who wish to learn C++. It can also be interesting for beginner C++ users who leaved out some possibilities of the language. A printed version is available at http://www.lulu.com/content/258714
Continue

Scientific Computing: C++ versus Fortran

Monday, June 16th, 2008

The language C++ has features which make it attractive for scientific computing: templates for generic programming, operator overloading for expressiveness, and object-orientation for abstraction and code reuse. Despite these features, the scientific computing community has been reluctant to adopt C++, partly due to performance problems. In the early 1990s, C++ programs were much slower than [...]

INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING USING C++

Monday, June 16th, 2008

This course was intended for students who want to learn more about object-oriented programming. Concepts presented are exemplified using the C++ programming language. This course is not intended to learn C++ in all its details. If you are interested in the language, please check out the Suggested Reading page for a reference to other online [...]