FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
template<typename T >
template< typename T > T FB::variant::cast ( ) const
inline

returns the value cast as the given type; throws bad_variant_type if that type is not the type of the value stored in variant

Exceptions
bad_variant_castThrown when bad variant cast.
Returns
value of type T

Definition at line 370 of file variant.h.

References get_type().

Referenced by FB::JSAPIAuto::FireJSEvent().

370  {
371  if (get_type() != typeid(T)) {
372  throw bad_variant_cast(get_type(), typeid(T));
373  }
374  return boost::any_cast<T>(object);
375  }
const std::type_info & get_type() const
Gets the type of the value stored in variant.
Definition: variant.h:307

Here is the call graph for this function: