Author Archives: robdesbois

Eric Niebler: out parameters, move semantics, and stateful algorithms This post from Eric, inspired by a prompt from Andrei Alexcandrescu, examines the interface of std::getline appraising its usability and performance. Eric looks at a few different designs, in particular those … Continue reading

Link | Posted on | Tagged , , , , , , | Leave a comment

Autumn [fall] 2013 C++ committee meeting

The C++ Standard Committee met in Chicago this week with a ballot resolution for the Committee Draft of the C++ 2014 Standard being its primary focus. Remaining time was devoted to processing DRs [defect reports] and issues from issue lists, … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Don’t couple streams with devices

Originally posted on Growing up:
A couple of weeks ago, a friend of mine coded an output stream that outputted strings through Win32 OutputDebugString function (you can use DebugView to monitor these kind of traces). His implementation had two main problems:…

Posted in Uncategorized | Tagged , , | Leave a comment

ISO C++ committee draft

Following the recent meeting of the ISO C++ standards committee, Working Group 21 (WG21) in Bristol, UK, a number of proposals have been accepted into the ‘Committee Draft’ of the next standard, currently scheduled for next year (“C++14″). Although this … Continue reading

Posted in Uncategorized | Tagged , , , , | 4 Comments

Boost compile error “no class template named ‘result’”

I’ve just come across a compiler error resulting from using boost::result_of with a C++11 lambda. I wasn’t actually using boost::result_of directly, but provided a lambda as the transforming functor for a boost::transform_iterator, which uses it behind the scenes. Here’s a … Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment

An implementation of generic lambdas (request for feedback) Faisal Vali has created an initial, alpha implementation (in Clang) of the current Generic (Polymorphic) Lambda Expressions proposal (N3418). This would see the addition of support for templated lambda expressions; the current … Continue reading

Link | Posted on | Tagged , , , | Leave a comment

Adventures in lock-free programming

I’ve been intrigued by the idea of lock-free programming since I discovered that C++0x (as it was then) was to gain library facilities for standardised, portable lock-free programming. The new <atomic> header enables us to perform atomic reads and writes … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Eric Niebler: stupid name lookup Eric Niebler shows a name lookup failure caused by a recursive template function inferring its return type via decltype. Stupid problem with a rather nasty hacky workaround, but also a likely change in C++14 that … Continue reading

Link | Posted on | Tagged , , , , | Leave a comment

Using the standard allocator for a different type [and get free functionality for your custom allocator]

Someone on comp.lang.c++.moderated recently asked “if I have a different allocator, can I use that allocator to allocate memory with vector or string…?”. Since there is not only the mechanism supported by C++98/03, but also a more general – and … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Generalised type-deduction for class template instance construction

I’ll wager that most C++ developers with experience of templates have at some point discovered the limitation that a class template’s parameters cannot be deduced in construction. Since type deduction can be performed in invocation of a function template however, I … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment