> It is not a big deal in this case but I am wondering how to define the > population protocol using something like std::vector so that > elementary protocols can be added or removed but each elementary > protocol is read-only. > ... like declaring the vector as std::vector<const ElemProt> but > that doesn't seem to work in the push_back method for the vector.
That should work (or I've misunderstood the problem). "std::vector<const ElemProt>" means pass-by-value. Could that have caused trouble? (E.g. if you didn't have a copy constructor defined.) If so, std::vector<const ElemProt*> might work? (Or better is vector of smart pointers, so you don't have to worry about memory management.) Or, define a copy constructor. Darren -- Darren Cook, Software Researcher/Developer http://dcook.org/work/ (About me and my work) http://dcook.org/blogs.html (My blogs and articles) _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel