CopyConstness

Copies constness of From to To.

The following type qualifiers affect the constness and hence are copied:

  • const
  • immutable
  • inout
  • inout const

Members

Aliases

CopyConstness
alias CopyConstness = To
Undocumented in source.
CopyConstness
alias CopyConstness = To
Undocumented in source.
CopyConstness
alias CopyConstness = To
Undocumented in source.
CopyConstness
alias CopyConstness = To
Undocumented in source.
CopyConstness
alias CopyConstness = To
Undocumented in source.

Parameters

From

Source type.

To

Target type.

Return Value

To with the constness of From.

Examples

static assert(is(CopyConstness!(int, char) == char));
static assert(is(CopyConstness!(const int, char) == const char));
static assert(is(CopyConstness!(immutable int, char) == immutable char));
static assert(is(CopyConstness!(inout int, char) == inout char));
static assert(is(CopyConstness!(inout const int, char) == inout const char));

static assert(is(CopyConstness!(shared int, char) == char));
static assert(is(CopyConstness!(shared const int, char) == const char));
static assert(is(CopyConstness!(shared inout int, char) == inout char));
static assert(is(CopyConstness!(shared inout const int, char) == inout const char));

static assert(is(CopyConstness!(const int, shared char) == shared const char));
static assert(is(CopyConstness!(const int, immutable char) == immutable char));
static assert(is(CopyConstness!(immutable int, const char) == immutable char));

Meta