[quote user="Bruce Reeves SRNS"]TextBlockPtr textBlock = textEditHandler->GetTextPart(eeh, *textPartId); TextBlockCR textBlockCR = *textBlock; RunRange runRange(textBlockCR);[/quote]
You've misunderstood the TextBlockCR parameter type. When you see f(T const& arg) in a function prototype, the function is telling you...
- It's taking a reference to the supplied type T, not a copy
- That is, if the supplied type is non-copyable, that's OK
- You don't waste time copying something
- It's taking a const reference to T
- It's promising not to modify the data
In other words, you don't have to create a T const& variable...
TextBlockPtr textBlock = textEditHandler->GetTextPart(eeh, *textPartId); RunRange runRange (*textBlock);