28 lines
475 B
D
28 lines
475 B
D
module hulk.range;
|
|
|
|
/**
|
|
* Representation of a memory range.
|
|
*/
|
|
struct Range
|
|
{
|
|
/** Range base address. */
|
|
void * _address;
|
|
|
|
/** Range length. */
|
|
size_t length;
|
|
|
|
/** Set the range address. */
|
|
@property void * address(T)(T a)
|
|
{
|
|
static assert(T.sizeof == size_t.sizeof);
|
|
_address = cast(void *)a;
|
|
return _address;
|
|
}
|
|
|
|
/** Get the range address. */
|
|
@property void * address()
|
|
{
|
|
return _address;
|
|
}
|
|
}
|