Add hulk.range

This commit is contained in:
josh committed 2023-06-10 22:21:55 -04:00
1 parent 2935903bae
commit c16aa0e9c3
1 file changed
+27
+27
View File
@@ -0,0 +1,27 @@
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;
}
}