# Glib::Variant< VariantBase > Class Template Reference
[Variant Datatype]

Specialization of Glib::Variant containing a Glib::VariantBase. More...

`#include <glibmm/variant.h>`

Inheritance diagram for Glib::Variant< VariantBase >:
[legend]

List of all members.

## Public Types

typedef GVariant* | CType
typedef VariantBase | CppType
typedef Variant< VariantBase > | CppContainerType

## Public Member Functions

| Variant ()
| Default constructor.
| Variant (GVariant* castitem, bool take_a_reference=false)
| GVariant constructor.

## Static Public Member Functions

static const Glib::VariantType& | variant_type ()
| Gets the Glib::VariantType.
static Variant< VariantBase > | create (const Glib::VariantBase& data)
| Creates a new Glib::Variant<VariantBase>.

## Detailed Description

### template <>
class Glib::Variant< VariantBase >

Specialization of Glib::Variant containing a Glib::VariantBase.

Since glibmm 2.28:

## Member Typedef Documentation

typedef Variant<VariantBase> Glib::Variant< VariantBase >::CppContainerType

typedef VariantBase Glib::Variant< VariantBase >::CppType

Reimplemented from Glib::VariantContainerBase.

typedef GVariant* Glib::Variant< VariantBase >::CType

Reimplemented from Glib::VariantContainerBase.

## Constructor & Destructor Documentation

Glib::Variant< VariantBase >::Variant | ( | ) | `[inline]`

Default constructor.

Glib::Variant< VariantBase >::Variant | ( | GVariant< VariantBase >* | castitem,
|  | bool | take_a_reference = `false`
| ) |  | `[inline, explicit]`

GVariant constructor.

Parameters:

  castitem | The GVariant to wrap.
  take_a_reference | Whether to take an extra reference of the GVariant or not (not taking one could destroy the GVariant with the wrapper).

## Member Function Documentation

static Variant<VariantBase> Glib::Variant< VariantBase >::create | ( | const Glib::VariantBase& | data ) | `[static]`

Creates a new Glib::Variant<VariantBase>.

Parameters:

  data | The value of the new Glib::Variant<VariantBase>.

Returns:
  The new Glib::Variant<VariantBase>.

Since glibmm 2.28:

static const Glib::VariantType& Glib::Variant< VariantBase >::variant_type | ( | ) | `[static]`

Gets the Glib::VariantType.

Returns:
  The Glib::VariantType.

Since glibmm 2.28: