/////////////////////////////////////////////////////////////////////////
//                                                                     //
// This file contains declarations used with STL and other templates.  //
//                                                                     //
/////////////////////////////////////////////////////////////////////////
#ifndef __TEMPLATE_DEFS_HPP__
#define __TEMPLATE_DEFS_HPP__


// This class allows the use of the "for_each" algorithm to delete all
// elements in a container
template <class T>
class deletor
{
public:
  void operator()(const T& p)
  {
    delete p;
  }
};


// This is a general absolute function
template <typename T>
inline T ABS(T a)
{
  return ( (a >= 0) ? (a) : (-a) );
}

#endif // __TEMPLATE_DEFS_HPP__
