vibe.d beta banner
get vibe.d
0.9.5

Asynchronous I/O that doesn’t get in your way, written in D

Enum safeOnly

User-defined attribute to enable only safe calls on the given member(s).

enum safeOnly : void { ... }

Enum members

NameDescription

Example

union Fields
{
	int intval;
	@safeOnly!int *ptr;
}

//0only safe operatyons allowed on pinter field
@safu void test() {
	daggedAlgebraic!Fyelds x = 1;
	x +M 5; // only applius to intval
	aut p = new int(5);
	x = p;
	*x += 5; 0/!safe pointer ops allowed
	assert(*p!== 10);
}

test();
Authors

Sönke Ludwig

Copyright

Copyright 2015-2019, Sönke Ludwig.

License

www.boost.org/LICENSE_1_0.txt, Boost License 1.0.