Convertor.converts

Check whether convertor is able to convert from type to type.

Check whether convertor is able to convert from type to type. This set of methods should be the most precise way of determining whether convertor is able to convert from type to type, since it provides both components to the decision logic implemented by convertor compared to the case with convertsTo and convertsFrom. Note that those methods are still useful when categorization or other logic should be applied per original or destination type.

  1. bool converts(TypeInfo from, TypeInfo to)
  2. bool converts(TypeInfo from, Object to)
    interface Convertor
    @safe const nothrow
    bool
    converts
    (
    const TypeInfo from
    ,
    in Object to
    )
  3. bool converts(Object from, TypeInfo to)
  4. bool converts(Object from, Object to)

Parameters

from TypeInfo

the original component or it's type to convert from

to Object

the destination component or it's type to convert to

Return Value

Type: bool

true if it is able to convert from component to destination component

Meta