How do I set the tilde (~) character correctly in LaTeX?
There’s a question discussing that on Stack Overflow, with a lot of answers. But dare I say it? They all suck:
\textasciitildeis too high,\texttildelowis too low.$\sim$can be tweaked to look more or less acceptable:{\raise.17ex\hbox{$\scriptstyle\sim$}}– but even that is a hack and uses the wrong symbol.
The point is – the tilde character is definitely an existing glyph in any font I am tempted to use. How can I just access and typeset that character, please? Without resorting to some other, similar-looking glyph that first needs to be nudged into place using a cunning combination of font size and raised boxes?
There must be a possibility to access that glyph directly from the font definition.
To demonstrate, look at this screenshot which attempts simply to display a C++ destructor of a type T (~T):

Compare this with the symbol we get in the browser: ~ – that’s what I want.
