I think "output" here should be a const * since you're copying from this.