using  data was my first idea  but we would either need to drop const from the parameter list  and dirty the interface as elliott commented or use a const cast which is pretty ugly besides  we probably should not be making raw changes to a std  string in the first place a std  vector char  could have worked better here or wrapping the strdup with std  unique ptr  but hopefully we will get rid of this copying once and for all with c 