Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Systems: HP aC++ Release Notes > Chapter 1 HP aC++ Release Notes

What’s in This Version

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

This section gives an overview of the new features introduced in this version of the HP aC++ compiler.

New Features in Version A.03.55.02

HP aC++ version A.03.55.02 supports the following new feature:

placement delete Feature Fully Supported

The placement delete feature is fully implemented in this version. If, during object initialization, as part of a placement new call (for example, during constructor invocation on a class object instance), an exception is thrown, then a matching placement delete call is made, with the same arguments as placement new.

Example:

class A {
      public:
      void *operator new(size_t);
      void operator delete(void *);
      void *operator new(size_t, A*);
      void operator delete(void*, A*);
      // ...
      };

Given the following placement new expression:

      A *ps = new (ptr) A;

If the default constructor for class A exits by throwing an exception, the implementation looks for an operator delete() in the scope of class A.

For an operator delete() to be considered, it must have parameters with types that match those of the operator new() called. Because the first parameter of an operator new() is always of type size_t and the first parameter of an operator delete() is always of type void*, the first parameter of each function is not considered for this comparison.

The implementation looks in class A for an operator delete() of the following form:

      void operator delete(void*, A*);

If operator delete() is found in class A, it is called to deallocate the storage. If operator delete() is not found, then it is not called.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2004 Hewlett-Packard Development Company, L.P.