www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: _based pointers in D?

reply bearophile <bearophileHUGS lycos.com> writes:
Robert:
 Hi, is there a similar construct like a _based pointer in D?

This is a cute feature, more docs here: http://msdn.microsoft.com/en-us/library/57a97k4e.aspx D doesn't have this feature, but you can try to implement it using a struct that defines opUnary!("*") and more. If your implementation comes out nicely and you are willing to share your code, then maybe Andrei can add it to Phobos2. Bye, bearophile
Jun 04 2010
parent =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench robertmuench.de> writes:
On 2010-06-05 03:12:58 +0200, bearophile said:

 D doesn't have this feature, but you can try to implement it using a 
 struct that defines opUnary!("*") and more. If your implementation 
 comes out nicely and you are willing to share your code, then maybe 
 Andrei can add it to Phobos2.

Thanks for the hint using structs and the operator stuff. I will definetly look into it and share my stuff. I will need something like this in conjunction with memory-mapped-files. -- Robert M. Münch http://www.robertmuench.de
Jun 05 2010