v8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
v8::Maybe< T > Class Template Reference

#include <v8.h>

Public Member Functions

V8_INLINE bool IsNothing () const
 
V8_INLINE bool IsJust () const
 
V8_INLINE T FromJust () const
 
V8_INLINE T FromMaybe (const T &default_value) const
 
V8_INLINE bool operator== (const Maybe &other) const
 
V8_INLINE bool operator!= (const Maybe &other) const
 

Friends

template<class U >
Maybe< U > Nothing ()
 
template<class U >
Maybe< U > Just (const U &u)
 

Detailed Description

template<class T>
class v8::Maybe< T >

A simple Maybe type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.

If an API method returns a Maybe<>, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a TerminateExecution exception was thrown. In that case, a "Nothing" value is returned.

Member Function Documentation

template<class T>
V8_INLINE T v8::Maybe< T >::FromJust ( ) const
inline
template<class T>
V8_INLINE T v8::Maybe< T >::FromMaybe ( const T &  default_value) const
inline
template<class T>
V8_INLINE bool v8::Maybe< T >::IsJust ( ) const
inline
template<class T>
V8_INLINE bool v8::Maybe< T >::IsNothing ( ) const
inline
template<class T>
V8_INLINE bool v8::Maybe< T >::operator!= ( const Maybe< T > &  other) const
inline
template<class T>
V8_INLINE bool v8::Maybe< T >::operator== ( const Maybe< T > &  other) const
inline

Friends And Related Function Documentation

template<class T>
template<class U >
Maybe<U> Just ( const U &  u)
friend
template<class T>
template<class U >
Maybe<U> Nothing ( )
friend

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