D Documentation  
T unbox!(T)(Box value)
Prototype:
T unbox!(T)(Box value)


This template function converts a boxed value into the provided type. To use it, instantiate the template with the desired result type, and then call the function with the box to convert.

This will implicitly cast base types as necessary and in a way consistent with static types - for example, it will cast a boxed byte into int, but it won't cast a boxed float into short. If it cannot cast, it throws UnboxException.

Example:
Box b = box(4.5);
bit u = unboxable!(real)(b); // This is true.
real r = unbox!(real)(b);

Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.