Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT C++] Possible to build std::vector of CaretCP or CaretPtr ?

$
0
0

[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...

  1. 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
  2. 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);

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>