Hello,
I don't understand how the problem I'm having is even possible--
lines.reserve(3 ); //Access violation
'lines' is a vector of structs ('Line'). It doesn't matter whether I use a vector<Line>::s ize_type object in place of '3', I get the same result.
Crucially, 'lines' is *not* empty at this point--the first element has been assigned.
The books I've looked at (e.g. Josuttis) have given me no indication that a post-assignment call to 'reserve' should be illegal--is it?
I'm new to C++ (but not C, Matlab), and I have run into errors arising from sloppiness on my part with 'const'--could that have something to do with it?
Again, if people have ideas as to how this error is even possible I would appreciate it (posting all my code seems like it would just cloud the issue at this point).
Thanks--
Best,
Matt
I don't understand how the problem I'm having is even possible--
lines.reserve(3 ); //Access violation
'lines' is a vector of structs ('Line'). It doesn't matter whether I use a vector<Line>::s ize_type object in place of '3', I get the same result.
Crucially, 'lines' is *not* empty at this point--the first element has been assigned.
The books I've looked at (e.g. Josuttis) have given me no indication that a post-assignment call to 'reserve' should be illegal--is it?
I'm new to C++ (but not C, Matlab), and I have run into errors arising from sloppiness on my part with 'const'--could that have something to do with it?
Again, if people have ideas as to how this error is even possible I would appreciate it (posting all my code seems like it would just cloud the issue at this point).
Thanks--
Best,
Matt
Comment