| Home | Libraries | People | FAQ | More

##### any_connection::backslash_escapes

Returns whether backslashes are being treated as escape sequences.

###### Synopsis

    bool
    backslash_escapes() const noexcept;

###### Description

By default, the server treats backslashes in string values as escape characters. This behavior can be disabled by activating the `NO_BACKSLASH_ESCAPES` SQL mode.

Every time an operation involving server communication completes, the server reports whether this mode was activated or not as part of the response. Connections store this information and make it available through this function.

- If backslash are treated like escape characters, returns `true`.
- If `NO_BACKSLASH_ESCAPES` has been activated, returns `false`.
- If connection establishment hasn't happened yet, returns `true`.
- Calling this function while an async operation that changes backslash behavior is outstanding may return `true` or `false`.

This function does not involve server communication.

###### Exception safety

No-throw guarantee.