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 >

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 (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 (view_or_value const &other)
| Construct a view_or_value from a copied view_or_value.
| ~view_or_value ()=default
| 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_value & | operator= (view_or_value &&other) noexcept
| Assign to this view_or_value from a moved-in view_or_value.
view_or_value & | operator= (view_or_value const &other)
| Assign to this view_or_value from a copied view_or_value.
View const & | view () const
| Get a View for the type.

## Related Symbols

(Note that these are not member symbols.)
template<typename View, typename Value>
bool | operator== (view_or_value< View, Value > const &lhs, view_or_value< View, Value > const &rhs)
| Compare view_or_value objects for (in)equality.
template<typename View, typename Value>
bool | operator!= (view_or_value< View, Value > const &lhs, view_or_value< View, Value > const &rhs)
| Compare view_or_value objects for (in)equality.
template<typename View, typename Value>
bool | operator== (view_or_value< View, Value > const &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, view_or_value< View, Value > const &rhs)
| Mixed (in)equality operators for view_or_value against View and Value types.
template<typename View, typename Value>
bool | operator!= (view_or_value< View, Value > const &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, view_or_value< View, Value > const &rhs)
| Mixed (in)equality operators for view_or_value against View and Value types.
template<typename View, typename Value>
bool | operator== (view_or_value< View, Value > const &lhs, Value const &rhs)
| Mixed (in)equality operators for view_or_value against View and Value types.
template<typename View, typename Value>
bool | operator== (Value const &lhs, view_or_value< View, Value > const &rhs)
| Mixed (in)equality operators for view_or_value against View and Value types.
template<typename View, typename Value>
bool | operator!= (view_or_value< View, Value > const &lhs, Value const &rhs)
| Mixed (in)equality operators for view_or_value against View and Value types.
template<typename View, typename Value>
bool | operator!= (Value const &lhs, view_or_value< View, Value > const &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

View must be constructible from an instance of class Value.

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

  view | A 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

  value | A Value type.

## view_or_value() [4/5]

template<typename View, typename Value>

bsoncxx::v_noabi::view_or_value< View, Value >::view_or_value | ( | view_or_value< View, Value > const & | 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 | ) |

inline noexcept

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

inline noexcept

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= | ( | view_or_value< View, Value > && | other | ) |

inline noexcept

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.

## 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 > const & | other | ) |

inline

Assign to this view_or_value from a copied view_or_value.

## view()

template<typename View, typename Value>

View const & 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!= | ( | Value const & | lhs,
|  | view_or_value< View, Value > const & | 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!= | ( | View | lhs,
|  | view_or_value< View, Value > const & | 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!= | ( | view_or_value< View, Value > const & | lhs,
|  | Value const & | rhs )

related

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

## operator!=() [4/5]

template<typename View, typename Value>

bool operator!= | ( | view_or_value< View, Value > const & | 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_or_value< View, Value > const & | lhs,
|  | view_or_value< View, Value > const & | rhs )

related

Compare view_or_value objects for (in)equality.

## operator==() [1/5]

template<typename View, typename Value>

bool operator== | ( | Value const & | lhs,
|  | view_or_value< View, Value > const & | 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== | ( | View | lhs,
|  | view_or_value< View, Value > const & | 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== | ( | view_or_value< View, Value > const & | lhs,
|  | Value const & | rhs )

related

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

## operator==() [4/5]

template<typename View, typename Value>

bool operator== | ( | view_or_value< View, Value > const & | 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_or_value< View, Value > const & | lhs,
|  | view_or_value< View, Value > const & | rhs )

related

Compare view_or_value objects for (in)equality.

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

- bsoncxx/v_noabi/bsoncxx/view_or_value-fwd.hpp
- bsoncxx/v_noabi/bsoncxx/view_or_value.hpp