Summary
I have made a first public release of the C++ Object Oriented Template Library ( OOTL ). An open-source library with the rather ambitious goals of providing object-oriented alternatives to the C++ primitives and the STL collections.

One of my biggest beefs with the STL and the C++ primitives, and a complaint I frequently hear being voiced, is that they are not object-oriented. One of the joys of C++ is that it is immensely flexible and powerful, so it does give us the tools to define our own object-oriented libraries.

Up until recently the only real obstacle I faced in making my own object oriented library was that polymorphism was expensive. The problem is now no longer significant with a new C++ interfaces library about to be released as a beta-release by Jonathan Turkanis called the Boost Interfaces Library ( BIL ). The BIL is not yet in fact a Boost library, but the name reflects the intention for eventual submission to the library.

The BIL is a set of macros which use a technique I wrote about in the September 2004 issue of the C++ Users Journal for implementing efficient interfaces without abstract base classes. The major advantages of this technique are that it provides us with run-time polymorphism without the overhead of virtual tables within objects. This means we can uses lightweight objects efficiently. Another advantage is that there is no need to pre-declare the intention of implementing interface as is required in Java and C#.

The OOTL has two primary sub-libraries, one for primitives and the other for collections. The OOTL primitives library, provides lightweight object-oriented alternatives to the C++ built-in types. The OOTL collections library provides a set of interfaces and classes for abstract data types such as Stacks, Queues, Deques, Arrays, Lists and so on.

RSS Feed

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.