struct to byte[]

Alexander Panek a.panek at brainsware.org
Wed Dec 13 03:36:04 PST 2006


novice2 wrote:
 > [...]
>> auto b = toByteArray!(Foo)(f); // Yay!
> 
> why we need two parameters?
> compiler don't know type of f?

That's how templates work. Another option would be to alias for 
frequently used types.

alias toByteArray!(Foo) FooToByteArray; // or similar



More information about the Digitalmars-d mailing list