[ English | Japanese ]




Bezel is a C++ library, provides policy based containers.

Bezel includes containers named vector, list, map and so on --- each name of them is the same as one of standard containers --- and some additional containers. They are designed to use with STL, so you can use them like standard containers. For example:

int main()
  typedef std::string T;
  bezel::list::list<T> v;
  { T s; while (getline(std::cin, s)) v.push_back(s); }
  std::copy(v.begin(), v.end(), std::ostream_iterator<T>(std::cout, "\n"));

Bezel's containers are different from standard containers on template parameters: they have extra template parameters for policy classes. Their behaviors are controllable --- algorithm and data structure, how to allocate memory and enable/disable debugging mechanisms --- through selecting policy classes. For example, list with singly-linked list data structure and std::malloc memory allocation is like this:

int main()
      bezel::scalar_allocation_policy::std_malloc<> >
  > v;

Policy classes are extracted at compile-time, so you can select container's behavior without any extra runtime calculation cost. You can specify both predefined policy class by Bezel like above and your own implementation to each template parameter of a container.


Basically, Bezel only requires a C++ compiler.

To use some policy classes, TR1, Boost or pthread library are required.


The basic way to install this package on Unix-like systems is:

$ ./configure
$ make
# make install  (as root, maybe)

Bezel only consists of header files, so you can also install Bezel with copying all header files to target directories.

Copyright and License

Copyright © 2007, 2008 Wakabayashi Masaki

Bezel is free software, distributed under the terms of the MIT license. It comes WITHOUT ANY WARRANTY.

SourceForge.net Logo