Why codedBuffer as const? copyInto is not a const function. smart pointer should return const pointer for operator -> if variable is const.