options_verifier Class Template Reference
[Utility Library]

#include <stlsoft/util/options_verifier.hpp>

List of all members.


Detailed Description

template<typename T, typename XP = option_verification_policy>
class stlsoft::options_verifier< T, XP >

Verifies that a given variable is equal to one of a set of options.

Public Types

typedef T value_type
typedef XP exception_policy_type
typedef XP parent_class_type
typedef options_verifier< T, XP > class_type

Public Member Functions

 options_verifier (T const &value, char const *failureMessage)
 options_verifier (T const &value, exception_policy_type policy, char const *failureMessage)
 options_verifier (class_type const &rhs)
 ~options_verifier ()
 Destructor.
template<typename U>
class_typetest (U const &u)

Constructor & Destructor Documentation

~options_verifier (  )  [inline]

Destructor.

Note:
The destructor for options_verifier deliberately does not declare a throw() clause because it does indeed throw an exception.
If we've not had a match, and we've not currently unwinding from another exception, then we report the failure.

Note:
This requires that options_verifier is *never* used inside a catch block.

CodeWarrior doesn't support uncaught_exception, so we have a potentially nasty situation whereby an options_verifier could be being destroyed as part of the cleanup of another exception. However, since options_verifier should never be created other than by calling verify_options(), this means that instances will always be temporary, which means that they'll never exist for long enough for an external exception to enter their lifetime. This is another reason why the failure message is char const*, and not string, and why m_value is a reference, not a value.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:59:03 2010 for STLSoft by  doxygen 1.5.6