On Clang and GCC this doesn't cause any issues. Is there anyway to just tell MSVC to ignore Run-Time Check Failure #3, for this method? firstId should always be assigned in that for loop. Does this involve the fact MSVC seems to think the range based iterator is incorrectly thought to be const int &, instead of const char *const?
EDIT: I'm using CLion CMake based build and not Visual Studio, so the project settings for this aren't in a menu.
"Run-Time Check Failure #3- The variable 'firstId' is being used without being initialized."
is generated after a check is performed at run-time.
It is a clear indication that the variable was never initialised / assigned a value.
In the posted code, the variable would remain uninitialised if:
a. connectsTo.empty() is true
b. for every ct in connectsTo, dialogueChildren.count(ct) == 0
Initialise firstId on line 5 with a default value.
eg. Id firstId = nullptr ; or Id firstId = "nothing" ;