ucommon
|
Generic templates for C++. More...
#include <ucommon/platform.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
class | array_pointer< T > |
Generic smart array class. More... | |
class | pointer< T > |
Generic smart pointer class. More... | |
class | temp_array< T > |
Manage temporary array stored on the heap. More... | |
class | temporary< T > |
Manage temporary object stored on the heap. More... | |
Defines | |
#define | THROW(x) ::abort() |
#define | THROWS(x) |
#define | THROWS_ANY |
Functions | |
template<class T > | |
bool | is (T &object) |
Convenience function to validate object assuming it is castable to bool. | |
template<class T > | |
bool | isnull (T &object) |
Convenience function to test pointer object. | |
template<class T > | |
bool | isnullp (T *object) |
Convenience function to test pointer-pointer object. | |
template<typename T > | |
T &() | max (T &o1, T &o2) |
Convenience function to return max of two objects. | |
template<typename T > | |
T &() | min (T &o1, T &o2) |
Convenience function to return min of two objects. | |
template<typename T > | |
void | swap (T &o1, T &o2) |
Convenience function to swap objects. |
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.
bool is | ( | T & | object | ) | [inline] |
Convenience function to validate object assuming it is castable to bool.
object | we are testing. |
Definition at line 422 of file generics.h.
bool isnull | ( | T & | object | ) | [inline] |
Convenience function to test pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
object | we are testing. |
Definition at line 432 of file generics.h.
bool isnullp | ( | T * | object | ) | [inline] |
Convenience function to test pointer-pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
object | we are testing. |
Definition at line 442 of file generics.h.
T&() max | ( | T & | o1, |
T & | o2 | ||
) | [inline] |
Convenience function to return max of two objects.
o1 | to check. |
o2 | to check. |
Definition at line 461 of file generics.h.
T&() min | ( | T & | o1, |
T & | o2 | ||
) | [inline] |
Convenience function to return min of two objects.
o1 | to check. |
o2 | to check. |
Definition at line 473 of file generics.h.
void swap | ( | T & | o1, |
T & | o2 | ||
) | [inline] |
Convenience function to swap objects.
o1 | to swap. |
o2 | to swap. |
Definition at line 451 of file generics.h.