HP aC++/HP C A.06.25 Release Notes

Table Of Contents
template<class T>
struct S {
static_assert(sizeof(T) > 4, "Type too small");
};
S<char> s1; // Will trigger an error when the static_assert
// declaration is instantiated.
Extended friend types
Support is now included for extended friend declaration syntax which allows for
non-class names and non-elaborated class names to be declared as friend.
Example:
typedef struct S ST;
typedef int const IC;
class C {
friend S; // Okay in C++0x mode
friend ST; // Okay in C++0x mode
friend int; // Okay in C++0x mode (but no effect)
friend IC; // Okay in C++0x mode (but no effect)
friend int const; // Error: cv-qualifiers not (directly) allowed
};
Rvalue references
Rvalue references are supported. This feature is enabled implicitly in C++0x mode.
The existence of rvalue references allows the declaration of move constructors, which
can be used to efficiently copy class objects by transferring the resources from a source
object that is soon to be defunct to a destination object.
The syntax for declaring an rvalue-reference is: typename&& rRef (as opposed to
the lvalue syntax: typename& lRef). The move constructor simply takes an rvalue
or lvaue reference and returns an rvalue reference. This prevents invocation of the copy
constructor; it therefore 'moves' around references without the need for copying the
objects.
Note that new mangling forms have been added for rvalue references; this matches
the Itanium ABI specification. The demangler c++filt has been updated to handle
these new encodings.
Example:
int& ref = 10; //Error; references must bind to lvalues.
int&& const_ref = 20; //C++0x rvalue references bind to rvalues.
Objectless references to non-static data members
In the 2003 C++ Standard, the name of a non-static class data member could appear
only in a member function of that class or one derived from it, in a member access
expression (x.m or p->m), or to form a pointer to member (&X::m).
12 What’s New in This Version