The ``++delete++`` operator expects a pointer argument. Passing it an object may compile and seem to run (with an implicit cast to pointer type) but it can result in unexpected behavior at runtime.


== Noncompliant Code Example

----
class CString {
public:
  operator const char*();
  // ...
};

void fun() {
  CString str;
  // ...
  delete str;  // Noncompliant
}
----


== Compliant Solution

----
void fun() {
  CString *pstr = new CString;
  // ...
  delete pstr;
}
----


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
