February 2014

N3923: A SFINAE-Friendly std::iterator_traits, v3 -- Walter Brown

Note: This paper was among the papers adopted into the draft Library Fundamentals TS yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3923

Date: 2014-02-14

A SFINAE-Friendly std::iterator_traits, v3

by Walter Brown

Excerpt:

This paper provides wording to reformulate the specification of iterator_traits so as to avoid a hard error when its template argument does not have the member types expected of a nonpointer iterator, and thus to make the trait conveniently usable in a SFINAE context.

N3921: string_view: a non-owning reference to a string, revision 7 -- Jeffrey Yasskin

Note: This paper was among the papers adopted into the draft Library Fundamentals TS at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3921

Date: 2014-02-14

string_view: a non-owning reference to a string, revision 7

by Jeffrey Yasskin

Excerpt:

References to strings are very common in C++ programs, but often the callee doesn't care about the exact type of the object that owns the data...

Google, LLVM, and Bloomberg have independently implemented a string-reference type to encapsulate this kind of argument. ...

Acknowledgements

I'd like to thank Marshall Clow, Olaf van der Spek, the Boost and std-proposals mailing lists, Chandler Carruth, Beman Dawes, Alisdair Meredith, and especially Daniel Krügler for help, advice, and wording in this paper.

N3920: Extending shared_ptr to Support Arrays, Revision 2 -- Peter Dimov

Note: This paper was among the papers adopted into the Library Fundamentals TS yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3920

Date: 2014-02-13

Extending shared_ptr to Support Arrays, Revision 2

by Peter Dimov

Excerpt:

This paper proposes adding array support to shared_ptr, via the syntax shared_ptr<T[]> and shared_ptr<T[N]>.

...

Thanks to Glen Fernandes, whose contribution of boost::make_shared for arrays prompted the boost::shared_ptr additions proposed herein.

Thanks to Daniel Krügler for reviewing an earlier revision of this paper and suggesting wording improvements.

Thanks to Jonathan Wakely for providing valuable feedback.

N3916: Polymorphic Memory Resources, r2 -- Pablo Halpern

Note: This paper was among the papers adopted into the draft Library Fundamentals TS yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3916

Date: 2014-02-14

Polymorphic Memory Resources -- r2

by Pablo Halpern

Excerpt:

A significant impediment to effective memory management in C++ has been the inability to use allocators in non-generic contexts. In large software systems, most of the application program consists of non-generic procedural or object-oriented code that is compiled once and linked many times. Allocators in C++, however, have historically relied solely on compile-time polymorphism, and therefore have not been suitable for use in vocabulary types, which are passed through interfaces between separately-compiled modules, because the allocator type necessarily affects the type of the object that uses it. This proposal builds upon the improvements made to allocators in C++11 and describes a set of facilities for runtime polymorphic memory resources that interoperate with the existing compile-time polymorphic allocators. In addition, this proposal improves the interface and allocation semantics of some library classes, such as std::function, that use type erasure for allocators.

...

11 Acknowledgements

I’d like to thank John Lakos for his careful review of my introductory text and for showing me what allocators can really do, if correctly conceived. Also, a big thank you to the members of my former team at Bloomberg for your help in defining the concepts in this paper and reviewing the result, especially Alexander Beels, Henry Mike Verschell, and Alisdair Merideth, who reworked the usage example for me. Thanks to Mark Boyall for promoting the addition of new allocators to the standard and for reviewing an early draft of this paper.

N3915: apply() call a function with arguments from a tuple (V3) -- Peter Sommerlad

Note: This paper was among the papers adopted into the draft Library Fundamentals TS yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3915

Date: 2014-02-14

apply() call a function with arguments from a tuple (V3)

by Peter Sommerlad

Excerpt:

This is a slightly update from the wording of N3829 as proposed by LEWG in Issaquah, adding std:: again where necessary and constexpr.

N3658 and its predecessor N3493 introduced integer_sequence facility and provide application of this features, for example apply() that is proposed in this paper.

...

Acknowledgements go to Jonathan Wakely for providing integer_sequence and providing apply() as the example in the working draft. He also suggested a big improvement to the resulting standard change from N3802.

Acknowledgements go to Mike Spertus for making me aware of the ... pack formation approaches.

Acknowledgements to the following persons on the c++std-lib reflector for their feedback and encouragement: Jonathan Wakely, Andy Sawyer, Stephan T. Lavavej, Jared Hoberock, and Tony van Eerd.

N3910: What can signal handlers do? -- Hans-J. Boehm

Note: This paper was among the final papers adopted into draft C++14 yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3910

Date: 2014-02-14

What can signal handlers do?

by Hans-J. Boehm

Excerpt:

This is a revision of N3787. It attempts to reflect the remaining comments from CWG discussions in Chicago. It also reflects further in person discussions with Jens Maurer and Clark Nelson at the Issaquah meeting, and subsequent feedback from both SG1 and core. Some of the wording here came directly from Jens.

... in the process of relaxing the restrictions on asynchronous signal handlers to allow use of atomics, we inadvertently made it impossible to use even local variables of non-volatile, non-atomic type.

N3905: Extending std::search to use Additional Searching Algorithms (Version 4) -- Marshall Clow

Note: This paper was among the papers adopted into the draft Library Fundamentals TS yesterday at the Issaquah WA USA ISO C++ meeting.

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3905

Date: 2014-02-14

Extending std::search to use Additional Searching Algorithms (Version 4)

by Marshall Clow

Excerpt:

Note: This is an update of n3703, from the summer 2013 mailing. ...

std::search is a powerful tool for searching sequences, but there are lots of other search algorithms in the literature. For specialized tasks, some of them perform significantly better than std::search. In general, they do this by precomputing statistics about the pattern to be searched for, betting that this time can be made up during the search.

The basic principle is to break the search operation into two parts; the first part creates a "search object", which is specific to the pattern being searched for, and then the search object is passed, along with the data being searched, to std::search.

This is done by adding an additional overload to std::search, and some additional functions to create the search objects.

Two additional search algorithms are proposed for inclusion into the standard: "Boyer-Moore" and "Boyer-Moore-Horspool". Additionally, the interface for the search objects is documented so that library implementers and end users can create their own search objects and use them with std::search.

...

Thanks to LWG, which reviewed an earlier version of this document, Matt Austern, who suggested overloading std::search, and especially Daniel Krügler, who wrote most of the wording for the standard, and Stephan T. Lavavej, who reviewed it.

NT² 3.0 and Boost.SIMD -- Stable release

TThe first stable release of the 3.x series of MetaScale’s open-source software is available: NT² 3.0. It also includes its spin-off project, Boost.SIMD (not yet a Boost library). Many Issues have been closed since last beta. The main focus of this release cycle was to fix performances issues and to stabilize some parts of the API.

NT² 3.0 Release Announcement

Source and binary packages can be downloaded here

Full changelog is available here

Find the Bug -- Andrzej Krzemieński

Can you spot the bug?

Find the Bug

by Andrzej Krzemieński

From the article:

Today, let's take a short test. Find what is likely to be a bug in the following code and suggest how to fix it.

void Catalogue::populate(vector<string> const& names)
{
  vec_.clear();
  vec_.resize(names.size());

  for (size_t i = 0; i < names.size(); ++i)
    vec_[i] = make_unique<Entry>(names[i]);
}

C++ Papers for Issaquah - Library, Graphics, Networking, Numerics and Undefined Behavior

This is the last part in the series for Issaquah, and its the most diverse:

C++ Papers for Issaquah - Library, Graphics, Networking, Numerics & Undefined Behavior

by Jens Weller

From the Article:

The 4th and last part about the C++ Papers for Issaquah. I already covered the first batch of proposals from the Library subgroup in the previous part, now its all about papers from Library, Graphics, Networking, Numerics and Undefined Behavior. A very diverse part.