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"]std::vector<CaretCP> startMatchCaret;

std::vector<CaretCR> startMatchCaret;[/quote]

The 'C' in CaretCP and CaretCR means const.  That is, read-only.  

By definition a reference such as CaretCR is a bad candidate for a standard container because you can't reassign a reference.

[quote user="Bruce Reeves SRNS"]startMatchCaret.push_back(matchStart);[/quote]

Since std::vector requires its template members to be copyable, I guess you're seeing a compiler error?

Header Caret.h tells us that Caret is an abstract class.  Since you can't instantiate or copy an abstract class, the compiler is telling that its unsuitable for storage in a standard container.

Perhaps classes RunIterator and RunRange might help?


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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