HP aC++/HP ANSI C A.06.28 Release (769149-001, March 2014)
For example:
struct S {
S(int);
S(): S(0) {} // Default constructor for S delegates to constructor
}; // S::S(int).
Raw string literals
This release of the compiler supports ‘Raw string literals’ as described by N2442 and N3077
under the C++11 compilation mode. It allows the specification of string literals containing characters
that otherwise have special meaning. These literals can span multiple lines and escape sequences,
and trigraphs are not translated.
For example:
const char *p = R"+++(a\
??=\0xa
z)+++"; // Equivalent to "a\\\n\?\?=\\0xa\nz"
UTF-8 string literals
This release of the compiler supports ‘UTF-8 string literals’ as described by N2442 under the
C++11 compilation mode. It allows strings with an encoding of UTF-8 (a popular representation
for Unicode).
For example:
const char s[] = u8"\u03a9"; // equivalent to "\xce\xa9"
Ref-qualifier on this
This release of the compiler supports ‘Ref-qualifier on this’ as described by N2439 under the
C++11 compilation mode. It allows the declaration of member functions that operates only on
lvalue or rvalue objects.
For example:
extern "C" int printf(const char *, ...);
struct A {
void p() & { printf("&\n"); }
void p() && { printf("&&\n"); }
};
int main() {
A a;
a.p(); // &
A().p(); // &&
}
Inline namespace
This release of the compiler supports ‘Inline namespace’ as described by N2535 under the C++11
compilation mode. This is done to specify that members of the namespace can be defined and
specialized as though they actually belong to the enclosing namespace.
For example:
namespace Networking {
namespace V1 {
class TCPSocket;
}
inline namespace V2 {
class TCPSocket;
}
class UDPSocket;
}
int main()
{
12 What’s new in this version?