Note: This article was originally written in Chinese by Ke Wen Lin/China/IBM. I translated this article into English.
Strings are frequently used in C++ programs. C++ Standard Library provides the <string> and <sstream> libraries, which are very useful for string manipulations, such as object encapsulation, safe and automatic type conversion, direct concatenation, and bound exceed avoidance. This article will discover a trap when using stringstream.str(). Here is an example:
Example 1:... [More]
Blog author: Kewen lin ( firstname.lastname@example.org )
Translator: Roy Hu
When we develop applications in the C programming language, we often use C time library functions, such as time, localtime , ctime , mktime , and asctime , to get or print out time-related information. But you might not notice some interesting phenomenon. Let's first take a look at the following example:
1 #include <stdio.h>
2 #include <time.h>
4 int main ()
Today, we announced Enterprise PL/I for z/OS V4.4 and z/OS XL C/C++ 2.1.
At SHARE in Boston , being held August 11-16, Visda Vokshoori , from the IBM compiler development team, will present the following sessions about these latest PL/I and C/C++ compilers for z/OS.
Session 13789: What's New in Enterprise PL/I and C/C++ will discuss all of the new features of the new compiler versions.
z/OS XL C/C++ features discussed will include:
· ... [More]
z/OS V2.1 XL C/C++ is an optional priced feature of the z/OS V2.1. It enables you to develop high-performing business applications and system programs on z/OS. It has the capability to fully exploit System z architectures, including the latest IBM zEC12 and zBC12 servers. This product is scheduled to GA with z/OS v2.1 on Sept. 30, 2013.
z/OS V2.1 XL C/C++ provides significant performance improvements over z/OS V1.13 XL C/C++, especially in 64-bit mode. Performance of compute-intensive integer benchmarks improved 11%... [More]
The XL C/C++ for AIX, V12.1 Fix Pack 4 (June 2013 PTF) is now available at the following links and on Fix Central:
XL C for AIX Fix Pack 4 (June 2013 PTF) for 12.1
Fix list for XL C for AIX
XL C/C++ for AIX Fix Pack 4 (June 2013 PTF) for 12.1
The XL C/C++ for Linux, V11.1 Fix Pack 8 (June 2013 Update) is now available at the following links and on Fix Central:
XL C/C++ for Linux Fix Pack 8 (June 2013 Update) for 11.1
Fix list for XL C/C++ for Linux
Runtime for XL C/C++ for Linux Fix Pack 8 (June 2013 Update) for 11.1
In C++03, the return type of a function template cannot be generalized if the return type relies on those of the template arguments. Here is an example, mul(T a, T b) is a function template that calculates the product of a and b. Arguments a and b are of an arbitrary type T, which is not decided until the template instantiation. Thus, we cannot declare a return type for mul to generalize all the cases for a*b. If we must define such a function template, we have to introduce another template parameter as follows:
template<class T ，... [More]
The May 2013 Update for XL C/C++ for Blue Gene/Q, V12.1 is now available at the following link and on Fix Central:
May 2013 Update for XL C/C++ for Blue Gene/Q, V12.1
Can't find the updates for your compiler? Check out our C/C++ compiler latest update page here .
z/OS V1R13 XL C compiler introduces HOT (high-order loop analysis and transformation) and IPA (inter-procedural analysis) support for Metal C, thus improves optimization for Metal C programs. Specifying the HOT option or the IPA option with the METAL option enables the compiler to find more optimization opportunities to improve application performance.
The following example shows how to compile a Metal C program with HOT.
xlc -qmetal -qhot -S a.c
This command produces a.s .
The following... [More]
The defaulted functions feature is newly introduced into the C++11 standard. In this article, I will explain this feature and provide some examples on how to use it.
C++ has six kinds of special member functions:
Copy assignment operators
Move assignment operators
These special member functions... [More]
The _Noreturn keyword enables optimizers to produce faster code by ignoring what would happen if the function returns.
A function declared with the _Noreturn specifier indicates that this function will not return the control to its caller.
You can use the _Noreturn specifier to declare or define any functions other than the main function. It is undefined behavior if such function actually returns.
However, any functions that are declared with _Noreturn must call one of the following... [More]
The XL C/C++ V12.1 Compiler introduces the support for the C++11 feature "right angle bracket". This new feature is designed to resolve the following problem:
In C++, consecutive right angle brackets (>) must be separated by a whitespace. Otherwise, they are treated as the bitwise right-shift operator (>>).Although this issue is minor, it is an annoyance to many new programmers.
For example, the most common text where consecutive right angle brackets appear is nested template-id.
The XL C/C++ for AIX, V11.1 Fix Pack 14 (May 2013 PTF) is now available at the following links and on Fix Central:
XL C for AIX Fix Pack 14 (May 2013 PTF) for 11.1
Fix list for XL C for AIX
X L C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
C++14 Committee Draft is here and can be accessed at isocpp.org . This is in keeping with the practice of greater transparency allowing us to publish the Committee Draft (CD) early instead of at fixed Standard reflector mailing intervals. Without this facility, we would have either had to hurry to make the publication 2 weeks ago or wait to publish it at the mid-term (between meeting) mailing interval, almost 2 months from now. Having isocpp.org publish material between mailings give us this greater flexibility and transparency. This was also... [More]
So much has been happening in OpenMP since SC 12 that I hope to capture it all in this post while flying to the ADC C++ meeting where I will talk about C++14, ISOCPP.org, and Transactional Memory.
First, the research arm of OpenMP is IWOMP, the annual research conference. You probably know by now that IWOMP 2013 will be in Canberra, Australia instead of its usual June summer time frame. This means that there is time (up till May 10) for new proposal submission. So if you have some research in OpenMP that should be exposed, please... [More]