I have unordered_set of strings.
And, on input i get a file. For example, this kind of strings.
"AA/BB/CC"
"YY/XX"
"BB/DD/LL"
I want to see in my set this:
AA
AA/BB
AA/BB/CC
BB
BB/DD
BB/DD/LL
YY
YY/XX
std::string instances_file { "/home/areg/Desktop/instance_file.txt" };
std::string str { "\n\t\r" };
char delimiter {'/'};
std::ifstream ifs (instances_file);
while(std::getline(ifs, str, delimiter))
unoset.insert(str);
Can you please provide a STL algorithm for doing this, or help me with the code?