UCommon
Data Structures | Namespaces | Defines | Functions
ucommon/generics.h File Reference

Generic templates for C++. More...

#include <ucommon/platform.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for generics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  ucommon::array_pointer
 Generic smart array class. More...
class  ucommon::pointer
 Generic smart pointer class. More...
class  ucommon::save_restore
 Save and restore global objects in function call stack frames. More...
class  ucommon::temp_array
 Manage temporary array stored on the heap. More...
class  ucommon::temporary
 Manage temporary object stored on the heap. More...

Namespaces

namespace  ucommon
 

Common namespace for all ucommon objects.


Defines

#define THROW(x)   ::abort()
#define THROWS(x)
#define THROWS_ANY

Functions

template<typename T >
T * ucommon::dup (const T &object)
 Convenience function to duplicate object pointer to heap.
template<>
char * ucommon::dup< char > (const char &object)
template<typename T >
void ucommon::dupfree (T object)
template<>
void ucommon::dupfree< char * > (char *object)
template<class T >
bool ucommon::is (T &object)
 Convenience function to validate object assuming it is castable to bool.
template<typename T >
bool ucommon::isnull (T &object)
 Convenience function to test pointer object.
template<typename T >
bool ucommon::isnullp (T *object)
 Convenience function to test pointer-pointer object.
template<typename T >
T &() ucommon::max (T &o1, T &o2)
 Convenience function to return max of two objects.
template<typename T >
T &() ucommon::min (T &o1, T &o2)
 Convenience function to return min of two objects.
template<typename T >
void ucommon::swap (T &o1, T &o2)
 Convenience function to swap objects.

Detailed Description

Generic templates for C++.

These are templates that do not depend on any ucommon classes. They can be used for generic C++ programming.

Definition in file generics.h.