port C++ to D - copy constness

dennis luehring via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 2 00:06:32 PDT 2014


i want to port this C++ code to good/clean D and have no real idea how 
to start

contains 2 templates - a slice like and a binary reader for an slice
main idea was to copy the immutablity of the slice data to the reader

http://pastebin.com/XX2yhm8D

the example compiles fine with http://gcc.godbolt.org/, clang version 
3.4.1 and compiler-options: -O2 -std=c++11

the slice_T template - could be maybe reduce down to an normal D slice
but i want to control the slice (im)mutability - so maybe there is still 
a need for the slice_T thing

i don't know if the binary reader read_ref method should be written 
totaly different in D

any tips, ideas?





More information about the Digitalmars-d-learn mailing list