old code new question: can you spot the undefined behaviour? omg! and how can I ever recover from this?

Show thread

@namark just a guess but assuming the seperator is a multi-character value and not a single or two letter value then it will ignore the content in the middle of the seperator and misidentify seperators.

Follow

@freemo nah, std::search takes care of that, it works with ranges that you specify using begin and end iterators/pointers, a very c++ thing. The split itself works fine and handles all the edge cases, it just has undefined behaviour, which you can't identify in any way other than sheer unbridled pedantry.

Β· Β· 1 Β· 0 Β· 1
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.