Class for easily casting boost::any's in assignment operations. More...
#include <AnyHelpers.h>
Class for easily casting boost::any's in assignment operations.
Consider the following code involving boost::any_cast
This class, AnyCast, attempts to streamline these casting operations and ensure that references are used whenever possible. Using AnyCast, the above code would be replace by
NOTE: This class stores a reference to the boost::any in question and errors may occur if an object of this class persists longer than the original boost::any. For this reason, we recommend using AnyCast in expressions like the code above;
Definition at line 33 of file AnyHelpers.h.
Public Member Functions | |
AnyCast (boost::any &objIn) | |
template<typename T > | |
operator T& () | |
|
inline |
Definition at line 36 of file AnyHelpers.h.
|
inline |
Definition at line 42 of file AnyHelpers.h.
References obj.
|
private |
Definition at line 45 of file AnyHelpers.h.
Referenced by operator T&().