MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
bsoncxx::v_noabi::view_or_value< View, Value > Class Template Reference

#include <bsoncxx/v_noabi/bsoncxx/view_or_value.hpp>

Description

template<typename View, typename Value>
class bsoncxx::v_noabi::view_or_value< View, Value >

Class representing a view-or-value variant type.

Public Member Functions

 view_or_value ()=default
 Default-constructs a view_or_value. This is equivalent to constructing a view_or_value with a default-constructed View.
 
 view_or_value (const view_or_value &other)
 Construct a view_or_value from a copied view_or_value.
 
 view_or_value (Value &&value)
 Constructs a view_or_value from a Value type. This object owns the passed-in Value.
 
 view_or_value (View view)
 Construct a view_or_value from a View. When constructed with a View, this object is non-owning. The Value underneath the given View must outlive this object.
 
 view_or_value (view_or_value &&other) noexcept
 Construct a view_or_value from a moved-in view_or_value.
 
 ~view_or_value ()=default
 Class View must be constructible from an instance of class Value.
 
bool is_owning () const noexcept
 Return whether or not this view_or_value owns an underlying Value.
 
 operator View () const
 This type may be used as a View.
 
view_or_valueoperator= (const view_or_value &other)
 Assign to this view_or_value from a copied view_or_value.
 
view_or_valueoperator= (view_or_value &&other) noexcept
 Assign to this view_or_value from a moved-in view_or_value.
 
const View & view () const
 Get a View for the type.
 

Related Symbols

(Note that these are not member symbols.)

template<typename View , typename Value >
bool operator== (const view_or_value< View, Value > &lhs, const view_or_value< View, Value > &rhs)
 Compare view_or_value objects for (in)equality.
 
template<typename View , typename Value >
bool operator!= (const view_or_value< View, Value > &lhs, const view_or_value< View, Value > &rhs)
 Compare view_or_value objects for (in)equality.
 
template<typename View , typename Value >
bool operator== (const view_or_value< View, Value > &lhs, View rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator== (View lhs, const view_or_value< View, Value > &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator!= (const view_or_value< View, Value > &lhs, View rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator!= (View lhs, const view_or_value< View, Value > &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator== (const view_or_value< View, Value > &lhs, const Value &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator== (const Value &lhs, const view_or_value< View, Value > &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator!= (const view_or_value< View, Value > &lhs, const Value &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 
template<typename View , typename Value >
bool operator!= (const Value &lhs, const view_or_value< View, Value > &rhs)
 Mixed (in)equality operators for view_or_value against View and Value types.
 

Constructor & Destructor Documentation

◆ ~view_or_value()

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::~view_or_value ( )
default

Class View must be constructible from an instance of class Value.

Class View must be default constructible. Destroys a view_or_value.

◆ view_or_value() [1/5]

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value ( )
default

Default-constructs a view_or_value. This is equivalent to constructing a view_or_value with a default-constructed View.

◆ view_or_value() [2/5]

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value ( View view)
inline

Construct a view_or_value from a View. When constructed with a View, this object is non-owning. The Value underneath the given View must outlive this object.

Parameters
viewA non-owning View.

◆ view_or_value() [3/5]

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value ( Value && value)
inline

Constructs a view_or_value from a Value type. This object owns the passed-in Value.

Parameters
valueA Value type.

◆ view_or_value() [4/5]

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value ( const view_or_value< View, Value > & other)
inline

Construct a view_or_value from a copied view_or_value.

◆ view_or_value() [5/5]

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value ( view_or_value< View, Value > && other)
inlinenoexcept

Construct a view_or_value from a moved-in view_or_value.

TODO CXX-800: Create a noexcept expression to check the conditions that must be met.

Member Function Documentation

◆ is_owning()

template<typename View , typename Value >
bool bsoncxx::v_noabi::view_or_value< View, Value >::is_owning ( ) const
inlinenoexcept

Return whether or not this view_or_value owns an underlying Value.

Returns
bool Whether we are owning.

◆ operator View()

template<typename View , typename Value >
bsoncxx::v_noabi::view_or_value< View, Value >::operator View ( ) const
inline

This type may be used as a View.

Returns
a View into this view_or_value.

◆ operator=() [1/2]

template<typename View , typename Value >
view_or_value & bsoncxx::v_noabi::view_or_value< View, Value >::operator= ( const view_or_value< View, Value > & other)
inline

Assign to this view_or_value from a copied view_or_value.

◆ operator=() [2/2]

template<typename View , typename Value >
view_or_value & bsoncxx::v_noabi::view_or_value< View, Value >::operator= ( view_or_value< View, Value > && other)
inlinenoexcept

Assign to this view_or_value from a moved-in view_or_value.

TODO CXX-800: Create a noexcept expression to check the conditions that must be met.

◆ view()

template<typename View , typename Value >
const View & bsoncxx::v_noabi::view_or_value< View, Value >::view ( ) const
inline

Get a View for the type.

Returns
a View into this view_or_value.

Friends And Related Symbol Documentation

◆ operator!=() [1/5]

template<typename View , typename Value >
bool operator!= ( const Value & lhs,
const view_or_value< View, Value > & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator!=() [2/5]

template<typename View , typename Value >
bool operator!= ( const view_or_value< View, Value > & lhs,
const Value & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator!=() [3/5]

template<typename View , typename Value >
bool operator!= ( const view_or_value< View, Value > & lhs,
const view_or_value< View, Value > & rhs )
related

Compare view_or_value objects for (in)equality.

◆ operator!=() [4/5]

template<typename View , typename Value >
bool operator!= ( const view_or_value< View, Value > & lhs,
View rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator!=() [5/5]

template<typename View , typename Value >
bool operator!= ( View lhs,
const view_or_value< View, Value > & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator==() [1/5]

template<typename View , typename Value >
bool operator== ( const Value & lhs,
const view_or_value< View, Value > & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator==() [2/5]

template<typename View , typename Value >
bool operator== ( const view_or_value< View, Value > & lhs,
const Value & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator==() [3/5]

template<typename View , typename Value >
bool operator== ( const view_or_value< View, Value > & lhs,
const view_or_value< View, Value > & rhs )
related

Compare view_or_value objects for (in)equality.

◆ operator==() [4/5]

template<typename View , typename Value >
bool operator== ( const view_or_value< View, Value > & lhs,
View rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.

◆ operator==() [5/5]

template<typename View , typename Value >
bool operator== ( View lhs,
const view_or_value< View, Value > & rhs )
related

Mixed (in)equality operators for view_or_value against View and Value types.


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