Skip to content
Discussion options

You must be logged in to vote

I find CppAD::vector easier to use than std::vector because it does error checking for the [] operator for indices out of range (when NDEBUG is not defined). It also does this for its iterators. In addition, the CppAD vector class is much easier to use in the debugger (simpler to view the data). Sometimes, I make it a configuration option to choose CppAD::vector or std::vector.

There are other vector classes that do index error checking; e.g. Eigen's vector class
https://cppad.readthedocs.io/latest/cppad_eigen.hpp.html

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pnik073
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants