Add comment to filenames in boostTest.cpp

This commit is contained in:
Jason Cobb
2020-05-18 10:24:38 -04:00
parent 899e6d7e2b
commit 63ad1092cd
+4 -1
View File
@@ -89,7 +89,10 @@ int registerTests(
}
else
{
static vector<unique_ptr<string>> filenames;
// This must be a vector of unique_ptrs because Boost.Test keeps the equivalent of a string_view to the filename
// that is passed in. If the strings were stored directly in the vector, pointers/references to them would be
// invalidated on reallocation.
static vector<unique_ptr<string const>> filenames;
filenames.emplace_back(make_unique<string>(_path.string()));
_suite.add(make_test_case(