QVariant::ConstPointer Class | Qt Core | Qt 6.11.0
Description: QVariant::ConstPointer is a template class that emulates a const pointer to QVariant.

- Qt 6.11
- Qt Core
- C++ Classes
- ConstPointer
- Qt 6.11.0 Reference Documentation

# QVariant::ConstPointer Class

template <typename Indirect> class QVariant::ConstPointer

QVariant::ConstPointer is a template class that emulates a const pointer to QVariant. More...

This class was introduced in Qt 6.11.

- List of all members, including inherited members

## Public Functions

| ConstPointer(Indirect &&pointed)
| ConstPointer(const Indirect &pointed)
QVariant::ConstReference<Indirect> | operator*() const

## Detailed Description

QVariant::ConstPointer wraps pointed-to value and returns a QVariant::ConstReference to it from its operator*(). This makes it suitable as replacement for an actual pointer. We cannot return an actual pointer from generic iterators as the iterators don't hold an actual QVariant.

## Member Function Documentation

### `[explicit noexcept(...)]` ConstPointer::ConstPointer(Indirect &&pointed)

Constructs a QVariant::ConstPointer from the value pointed to.

Note: This function is noexcept when `std::is_nothrow_move_constructible_v<Indirect>` is `true`.

### `[explicit noexcept(...)]` ConstPointer::ConstPointer(const Indirect &pointed)

Constructs a QVariant::ConstPointer from the value pointed to.

Note: This function is noexcept when `std::is_nothrow_copy_constructible_v<Indirect>` is `true`.

### `[noexcept(...)]` QVariant::ConstReference<Indirect> ConstPointer::operator*() const

Dereferences the QVariant::ConstPointer to a QVariant::ConstReference.

Note: This function is noexcept when `std::is_nothrow_copy_constructible_v<Indirect>` is `true`.