The Open
D
Programming Language
Learn
Language
Library
Contribute
Blog
isErr
mir
algebraic
Checks if T is a instance of
Err
or if it is annotated with
reflectErr
.
template
isErr (
T
) {
enum
bool
isAggregateType
(
T
)
; via
import
std
.
traits
:
isAggregateType
,
hasUDA
;
;
eponymoustemplate
hasUDA
(alias symbol, alias attribute)
via
import
std
.
traits
:
isAggregateType
,
hasUDA
;
;
static if
(
is(T == enum) || isAggregateType!T
)
static if
(
is(immutable T == immutable Err!V, V)
)
enum
isErr
;
static if
(
is(T == enum) || isAggregateType!T
)
static if
(!(
is(immutable T == immutable Err!V, V)
))
static if
(
hasUDA!(T, reflectErr)
)
enum
isErr
;
version(D_Exceptions)
static if
(
is(T == enum) || isAggregateType!T
)
static if
(!(
is(immutable T == immutable Err!V, V)
))
static if
(!(
hasUDA!(T, reflectErr)
))
enum
isErr
;
version(!D_Exceptions)
static if
(
is(T == enum) || isAggregateType!T
)
static if
(!(
is(immutable T == immutable Err!V, V)
))
static if
(!(
hasUDA!(T, reflectErr)
))
enum
isErr
;
static if
(!(
is(T == enum) || isAggregateType!T
))
enum
isErr
;
}
Meta
Source
See Implementation
mir
algebraic
aliases
Nullable
Variant
assumeOk
autoGetMember
autoMatch
autoMatchMember
autoVisit
getMember
match
matchMember
none
optionalGetMember
optionalMatch
optionalMatchMember
optionalVisit
some
suit
tryGetMember
tryMatch
tryMatchMember
tryVisit
visit
enums
algMeta
algTransp
algVerbose
reflectErr
functions
err
nullable
structs
Algebraic
This
templates
Err
NoneVariant
SomeVariant
TaggedVariant
TypeSet
ValueTypeOfNullable
isErr
isResultVariant
stripErr
visitImpl
variables
isLikeNullable
isLikeTaggedVariant
isLikeVariant
isNullable
isTaggedVariant
isTypeSet
isVariant
Checks if T is a instance of Err or if it is annotated with reflectErr.