How about you give us some real code that compiles and gives you the error. :icon_rolleyes: It's kind of hard to tell you how your code is wrong when you summarize it using pseudocode.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
You can't inherit from the class with private constructors and/or destructors.
So it's doubtful you catch run-time error: you can't compile С++ code based on this pseudocode.
If std::vector is empty then v.back does not return consistent std::string.
Please, present more adequate info about your problem.
ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
If your real situation is exactly like this test, then it's because your data is wrong. Assigning all of the items to the vector is based on the line beginning with "stuff" followed by a space. So you're trying to get the last element of an empty vector, which doesn't exist, so naturally you should expect it to bomb.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401