Standardization

Open and Efficient Type Switch for C++ -- Solodkyy, Dos Reis, and Stroustrup

Here's a recent highlight from the pre-Portland mailing that you might have missed:

Open and Efficient Type Switch for C++

Yuriy Solodkyy, Gabriel Dos Reis, Bjarne Stroustrup

... we implement a type switch construct as an ISO C++11 library, called Mach7. This library-only implementation provides concise notation and outperforms the visitor design pattern. ... For closed sets of types, its performance roughly equals equivalent code in functional languages, such as OCaml and Haskell.

C++ is a powerful library-building language. Whenever possible, we prefer to add new functionality as a library rather than in the language. This is an excellent example of where a C++ library-only solution can get equivalent performance to the language support included in some popular functional languages.

New paper: N3528, Minutes of Feb 5 2013 SG1 (concurrency) teleconference

As an experiment to make C++ standardization papers more accessible, we're trying out a new idea: posting links to papers as the papers become available. This does not replace the committee mailings; the papers will still be collected and made available in the regular mailings (about four times a year) and those mailings will also still be announced here. The purpose of this experiment is to try to publish papers earlier and more often, so as to make it easier to get feedback sooner from a wider audience and reduce the glut of papers that need to be absorbed before meetings. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Note that some papers, like this one, will be mainly informational rather than proposal papers for technical discussion. 

Here's the first:

Document Number: N3528

Date: 2013-02-05

 

Minutes of Feb 5 2013 SG1 Phone Call

by Pablo Halpern

 

Online C++ compilers


Many people don't realize how many web pages offer access to try out C++ compilers, including many of the latest compilers with burgeoning C++11 language support. So we thought we'd publish a list.

Do you:

  • want to try out C++, but don't have a compiler installed?
  • want to try out a C++11 feature your compilers don't yet support?
  • want to compare the results of compiling a test program using different compilers?

Then try one of these online compilers! Some are compile-only to let check whether your code is legal, and some let you also run your test programs to see their output. For each, we include a list of the compilers that the page currently supports -- they include the latest from Clang (3.2, Dec 2012), GCC (4.8.0 prerelease), Intel (13.0, Oct 2012), and Microsoft (VC++ alpha CTP, Nov 2012).

This list is now also available on the Get Started! page.

Reminder: Registration deadline for spring ISO C++ meeting

Today on the committee reflector, the Bristol standards meeting host, Roger Orr, reminded us of the registration deadline.

This is also of interest to people who are not regular standards meeting. If you are in the Bristol area or otherwise interested in attending part of the standards meeting to see what's going on, you're welcome to attend -- see "How to Participate at Face-to--Face Meetings" on the Meetings and Participation page for more details.

Roger Orr writes:

Hello all, here is a reminder of booking details for the meeting.

 

Many of you have already booked for the Apr 15-20 (6-day) meeting of WG21 in Bristol, UK, and need read no further.

If you have not yet booked but are intending to come, please note that the room reservations at the hotel are time-limited. To ensure a room please book before the release date early in February.

 

  • The hotels will not claim the cost until the conference.
  • There is no time limit for registering for attendance if you are making other arrangements for accommodation.

The following link will take you to the WG21 tab of the ACCU booking site:

 

http://www.cvent.com/events/accu-2013/custom-22-09ec03b22c4f4a0a832e28126a4585fc.aspx

As mentioned in N3397the event is colocated with the ACCU conference (Apr 9-13).

You can book hotel accomodation at the time of registration: either in the conference hotel -- the Bristol City Centre  Marriott -- or the nearby Bristol Hotel (Cabot Circus) which is a little cheaper.

 

If you are only attending WG21 select registration type "WG21 conference only" in online registration.

If you are attending both the ACCU conference and the WG21 meeting you can book both at the same time (and therefore get continuous hotel room occupation) select registration type ACCU Member or ACCU Non-Member as appropriate.

 

The site also contains some tabs with information about Bristol, the hotels, and travel.

If you have any questions about Bristol please contact me (host), or Herb Sutter (convenor) as appropriate.

 

I look forward to seeing many of you in Bristol in April!

Regards,

Roger.

January standards papers mailing available

The between-meetings standards papers mailing is now available. It includes the spring meeting agenda, updated issues lists, and a number of new papers including at least one that came through the public std-proposals forum. (Update: Please also direct discussion about these papers to that forum.)

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup Disposition
SD-1 2013 PL22.16/WG21 document list Clark Nelson 2013-01-15 2013-01      
SD-2 ISO WG21 and INCITS PL22.16 membership list Clark Nelson 2013-01-11 2013-01      
SD-3 SC22/WG21 (C++) Study Group Organizational Information Herb Sutter 2012-10-04 2012-09      
SD-5 WG21 and PL22.16 (C++) Joint Mailing and Meeting Information Herb Sutter 2010-09-20 2012-09      
2013-01
N3493 Compile-time integer sequences Jonathan Wakely 2013-01-11 2013-01   Library Evolution  
N3494 A proposal to add special mathematical functions according to the ISO/IEC 80000-2:2009 standard Vincent Reverdy 2012-12-19 2013-01   Library Evolution  
N3495 inplace realloc Ariane van der Steldt 2012-12-07 2013-01   Library Evolution  
N3496 AGENDA, PL22.16 Meeting No. 60, WG21 Meeting No. 55, April 15-20, 2013 -- Bristol, UK Stephen D. Clamage 2013-01-02 2013-01      
N3497 Runtime-sized arrays with automatic storage duration (revision 4) Jens Maurer 2013-01-01 2013-01 N3467 Core  
N3498 Core Issue 1512: Pointer comparison vs qualification conversions (revision 2) Jens Maurer 2013-01-07 2013-01 N3478 Core  
N3499 Digit Separators Lawrence Crowl 2012-12-19 2013-01 N2281 Core  
N3500 New assert variants Olaf van der Spek 2012-11-28 2013-01   Library Evolution  
N3501 C++ Standard Core Language Active Issues, Revision 82 William M. Miller 2013-01-14 2013-01 N3480 Core  
N3502 C++ Standard Core Language Defect Reports and Accepted Issues, Revision 82 William M. Miller 2013-01-14 2013-01 N3481 Core  
N3503 C++ Standard Core Language Closed Issues, Revision 82 William M. Miller 2013-01-14 2013-01 N3482 Core  
N3505 Filesystem Library Proposal (Revision 4) Beman Dawes 2013-01-12 2013-01 N3399 Filesystem  
N3506 A printf-like Interface for the Streams Library Zhihao Yuan 2012-12-26 2013-01   Library Evolution  
N3507 A URI Library for C++ G. Matthews, D. Berris 2013-01-11 2013-01 N3484 Networking  
N3508 Any Library Proposal (Revision 2) B. Dawes, K. Henney 2013-01-11 2013-01 N3390 Library  
N3509 Operator Bool for Ranges Olaf van der Spek 2012-12-19 2013-01   Library Evolution  
N3510 std::split(): An algorithm for splitting strings Greg Miller 2013-01-10 2013-01 N3430 Library Evolution  
N3511 exchange() utility function Jeffrey Yasskin 2013-01-10 2013-01   Library Evolution  
N3512 string_ref: a non-owning reference to a string, revision 2 Jeffrey Yasskin 2013-01-11 2013-01 N3442 Library Evolution  
N3513 Range arguments for container constructors and methods, wording revision 2 Jeffrey Yasskin 2013-01-11 2013-01 N3456 Ranges  
N3514 A Proposal for the World's Dumbest Smart Pointer Walter Brown 2012-12-19 2013-01   Library Evolution  
N3515 Toward Opaque Typedefs for C++1Y Walter Brown 2013-01-11 2013-01   Evolution  
N3516 C++ Standard Library Active Issues List (Revision R81) Alisdair Meredith 2013-01-15 2013-01 N3473 Library  
N3517 C++ Standard Library Defect Report List (Revision R81) Alisdair Meredith 2013-01-15 2013-01 N3474 Library  
N3518 C++ Standard Library Closed Issues List (Revision R81) Alisdair Meredith 2013-01-15 2013-01 N3475 Library  
N3519 Feb 5, 2013 SG1 Teleconference Announcement and Agenda Hans Boehm 2013-01-11 2013-01   Concurrency  
N3520 Critical sections in vector loops Robert Geva 2013-01-11 2013-01   Concurrency  
N3521 convert() utility function Jeffrey Yasskin 2013-01-12 2013-01   Library Evolution  

 

Update from the Ranges Study Group

In December, we announced the opening of the SG9 (Ranges) mailing list. Since then, the activity on it has been nothing short of amazing, and the discussion is of a markedly high quality. Ranges promise a improvement in usability, power, and safety for the STL. If you have ever wanted to see how the C++ Standardization Committee crafts the future of C++, sidle on over to the Ranges group and learn about the future of the STL from many of the people who have helped shape it since its inception. Watch tomorrow's C++ take shape today, and maybe help shape it yourself.

Read the list archives here, or sign up to get the blow-by-blow here.

P.S. You can start using (one implementation of) Ranges today over at Boost (see Boost.Range's docs).

SG 9 (Ranges) mailing list is now open

Marshall Clow, chair of SG9 (Ranges) has announced the SG9 mailing list is now open:

Sign up at http://www.open-std.org/mailman/listinfo/ranges.

I'll post a welcome message to start off the discussion on Wednesday morning; please hold off on posting until then so that people have a chance to join.

Thanks - and have a Happy New Year!

-- Marshall

P.S. thanks to Keld [Simonsen] for setting up the list.

An implementation of generic lambdas (request for feedback) -- Faisal Vali

This week, Faisal Vali shared an initial "alpha" implementation of generic lambdas in Clang. Faisal is the lead author of the proposal (N3418), with Herb Sutter and Dave Abrahams.

To read and participate in the active discussion, see the message thread on std-proposals.

Here is a copy of Faisal's announcement:

Motivated by the positive feedback we received regarding Generic Lambdas (during the October 2012 ISO C++ Standards Meeting in Portland), I have implemented a reasonably complete (unless I am missing something obvious) implementation (http://faisalv.github.com/clang-glambda/) of most of the proposal (named lambda syntax for functions has not been attempted) using a fork of Clang.

 

We would like to encourage developers who are interested in this feature, to either compile the code or download the binaries (sorry, only Windows for now) and play with the implementation and provide us with feedback so that we can incorporate it within our next revision of the document.

The following link: http://faisalv.github.com/clang-glambda/, has some instructions (towards the bottom) on how to compile the code or use the binaries for Windows.

 

Any and all constructive feedback will be greatly appreciated.

The current version (12/2012) implements subproposals 2.1, 2.2, 2.3 and 2.5.

 

2.1 Allow the type-specifier within a parameter declaration of a lambda to be auto (i.e. auto is mandatory)

auto Sum = [](auto a, decltype(a) b) { return a + b; };
int i = Sum(3, 4);
double d = Sum(3.14, 2.77);

 

2.2 Allow the use of familiar template syntax in lambda expressions

auto NumElements = []<int N>(auto (&a)[N]) { return N; };
int arri[]{1, 2, 3};
double arrd[]{3.14, 2.77, 6.626};
auto total = NumElements(arri) + NumElements(arrd);

 

2.3 Permit a lambda body to be an expression

int local = 10;
auto L = [&](auto a) a + ++local;

 

2.5 Autogenerate a conversion to function pointer in captureless generic lambdas

auto L = [](auto a, decltype(a) b) { return a + b; };
int (*fp)(int, int) = L;

 

Thank you and looking forward to the feedback!

Library WG split: Library and Library Evolution

The Committee page has been updated to reflect an organizational change: WG21 has decided to split the Library working group into a core “Library” group (LWG) and a forward-looking “Library Evolution” group (LEWG), following the model of how the language side is split between “core” and “evolution.”

Summary:

  • Library (LWG) is responsible for standard library quality and will handle non-evolutionary DR/issue processing and the wording/fine-tuning of new library facilities. Alisdair Meredith will continue to chair this group.
  • Library Evolution (LEWG) is responsible for processing and refining new proposals. Like EWG on the language side, Library Evolution may choose to handle the proposals directly or else recommend spinning up a Study Group. When a library-only SG is ready to progress, LEWG will determine whether to proceed, and if so the target ship vehicle (IS or TS). We are very grateful that Beman Dawes has agreed to serve as an interim “bridge” chair for a year or two, to apply his long experience with LWG to get Library Evolution set up and moving in the right direction, and to find and train a longer-term chair – so part of Beman’s job immediately will be to start to replace himself.

Thank you to Beman for his volunteering to lead Library Evolution, and to Alisdair for his continued excellent efforts leading Library! It’s hard work, and much appreciated.

Modules update video available -- Doug Gregor

MP4 video of Doug Gregor's talk on Modules is now available via llvm.org. Combining links here:

Modules (MP4 video) (PDF slides)

Doug Gregor - Apple

The C preprocessor has long been a source of problems for programmers and tools alike.

Programmers must contend with widespread macro pollution and #include-ordering problems due to ill-behaved headers. Developers habitually employ various preprocessor workarounds, such as LONG_MACRO_PREFIXES, #include guards, and the occasional #undef of a library macro to mitigate these problems.

Tools, on the other hand, must cope with the inherent scalability problems associated with parsing the same headers repeatedly, because each different preprocessing context could effect how a header is interpreted – even though the programmer rarely wants it.

Modules seeks to solve this problem by isolating the interface of a particular library and compiling it (once) into an efficient, serialized representation that can be efficiently imported whenever that library is used, improving both the programmer’s experience and the scalability of the compilation process.