XL C/C++ V11.1 supports extern templates, enum class, right angle brackets -- IBM C/C++ Cafe

[Ed.: We're pleased to report continued progress toward conformance by C++ compiler vendors. This post combines three features contributed by Cecilia, christineli, and Alice Ying]

The IBM XL C/C++ V11.1 now supports several new C++11 features.

With extern templates, you can provide an explicit instantiation declaration for a template specialization if an explicit instantiation definition of the template exists in other translation units or later in the same file. If one translation unit contains the explicit instantiation definition, other translation units can use the specialization without having the specialization instantiated multiple times.

With right angle brackets, you can avoid having to write an extra space in code like vector<list<int> >, and just write vector<list<int>> the way Stroustrup intended. 

With scoped enumerations, you can avoid the following problems with the traditional enumerations:

  • Implicit conversion to an integer
  • Inability to specify the underlying type
  • Scope issue: enumerator is injected into (a.k.a. "pollutes") the enclosing scope

Enjoy!

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.