Re: std.bigint: BigInt conversion

2012-11-25 Thread Stian
On Sunday, 25 November 2012 at 21:36:38 UTC, novice2 wrote: How i can convert ubyte[] to BigInt and BigInt to ubyte[] ? Or uint[]... For example, i need RSA crypto. I should get ubyte[] data, ubyte[] key, convert it to BigInt, calculate, then save result as ubyte[] data again. But i see BigI

Re: Returning const ref (structs) in D

2012-11-24 Thread Stian
After reading that a couple of times it is a bit clearer, thank you. I need to wrap my head around this. I am working on a simple render/game engine, where, of course, vectors and matrices are flying around. Is the compiler sophisticated enough that is it able to avoid the copying. For instan

Returning const ref (structs) in D

2012-11-24 Thread Stian
Okay, Im trying to wrap my head around how i can return a reference from a class. Lets say I have some class Foo that stores a struct Bar that stores many bytes. In C, i would have a function const Bar & getBar(){return bar;} In code, i could get a (const) reference to bar using const Bar & v