== Why is this an issue?

The repetition of a unary operator is usually a typo. The second operator invalidates the first one in most cases:

[source,cpp]
----
int i = 1;

int j = - - -i;  // Noncompliant: equivalent to "-i"
int k = ~~i;     // Noncompliant: equivalent to "i"

bool b = false;
bool c = !!!b;   // Noncompliant: equivalent to "!b"
----

On the other hand, while repeating the increment and decrement operators is technically correct, it obfuscates the meaning:


[source,cpp]
----
int i = 1;
int j = ++ ++i;  // Noncompliant
int k = ----i; // Noncompliant
----

Using ``+=`` or ``-=`` improves readability:

[source,cpp]
----
int i = 1;
i += 2;
int j = i;
i -=2;
int k = i;
----


This rule raises an issue for repetitions of:

* ``++!++``, ``++~++``, ``++-++``, and ``+``
* the increment `++` and decrement `- -` operators in {cpp}

=== Exceptions

The rule ignores boolean normalization ``++!!++``.

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

'''
== Comments And Links
(visible only on this page)

=== on 12 Jul 2016, 14:55:20 Ann Campbell wrote:
\[~alban.auzeill] it's better not to escape chars for correct Jira display because the RuleAPI doesn't need/won't use the escaping and will output the backslashes literally.

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
