tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cannot compile <future> with gcc 4.6



On Thu, 30 Aug 2012 11:38:34 +0200
Martin Husemann <martin%duskware.de@localhost> wrote:

> On Wed, Aug 29, 2012 at 11:38:33PM -0400, James K. Lowden wrote:
> >   The project I'm working on needs C++11
> 
> I'm curious, why is that?

Fair question gently put.  OK.  There are technical and social reasons. 

C++11 does solve some problems in C++.  The auto keyword is one, the
ability to infer container types another.  The std library has been
expanded usefully and conservatively.  

If you're writing threaded C++ code, the last decade has been a bloody
minefield.  The C++11 brings us mutex and thread and future, among
others.  Sure, threads are an abomination because they break the C's
presentation of the process as a single thread of control (which C++
shares).  Threads return us to the bad old days -- of the 1960s --
before processes each had their own address space.  Obvious as that may
be, they've seduced millions with their siren call.  

Among those millions are many who've lived with Windows for a decade or
two, for whom fork and select are things done in a restaurant.
Microsoft's tepid support of Posix, to put it mildly, has now tarred a
generation.  Not only that: If you want your portable software to run
on some of those millions of Windows machines, you're going to bump
into numerous technical biases on that platform favoring threads.  

Programmers working together routinely face the question of what
standard to meet, what's too old and what's too new.  C++11, in the
mind of many, has moved from "soon" to "now" because it standardizes
things that weren't, and because the language is in fact a little
better.  There's tremendous work going on at GNU and Clang to embrace
it.  

Someone may ask how all this becomes a "need".  If I want to work with
this project, it's going to be in C++ and sooner or later that will
mean C++11.  Some of it is threaded, and <future> is both technically
well thought out and, mostly, portable.  Except on operating systems
that don't support it.  :-(

--jkl


Home | Main Index | Thread Index | Old Index