You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want these to output "Undefined behavior detected" and "3 Undefined behavior detected", respectively. Note that a space was added in the second result but not the first. Next, consider:
geordi: { tracked::B x, y; cout << 'a'; }
We want this to output "B0* B1* a B1~ B0~". Note that not every tracking message is preceded by a space of its own, nor is every tracking message followed by one.
Geordi has a systematic way of dealing with these situations where we only want a space to be inserted if required to separate things. The mechanism is as follows:
1. The program outputs the Unicode character PARAGRAPH SEPARATOR (U+2029) whenever separation is desired.
2. EvalCxx.hsc erases any U+2029's occurring at the beginning and end of the output, and replaces any other sequence of successive U+2029's with a single space.
For the above examples, the desired output can now be easily achieved by outputting an U+2029 before "Undefined behavior detected", and by outputting U+2029's before and after each tracking message.