locate

Given a locator, locates an object and attempts to convert to T type.

Given a locator, locates an object and attempts to convert to T type. When an object of T type is located, it is simply casted to T type. When an value of T type is located, the func attempts to cast the requested object to Wrapper!T, and will return it, instead of T directly. In case of failure an InvalidCastException is thrown in debug environment.

Parameters

locator Locator!(Object, string)

the locator that contains the data with id as identity

Return Value

Type: auto ref

Object casted to desired type.

Throws

InvalidCastException in debug mode when actual type of object is not of type that is requested.

Meta