Enable C++ 11 support in Makefile

For both gcc and clang, although it seems to work
only with gcc 4.7 at the moment.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Convert to use std::mutex and std::condition_variable

Retire our home-grown alternatives and a good chunk of
platform dependant code.

No functional change.
Convert to use std::thread

And also a bit of <functional> while there :-)

No functional change.
Merge from master
Convert to std::chrono

For now keep the Time struct wrapper becuase this std::chrono
stuff is too verbose for my taste.

With this patch we have removed almost all remaining
platform dependant code!

No functional change.
Prefer composition to inheritance of std::thread

We really don't need to expose std::thread
to outside.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use std::thread::hardware_concurrency()

And retire another chunk of platform
specific code.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire platform.h

Last code was for suppressing some silly
MSVC warnings (moved to types.h) and add
support for fixed width integer types.

The latter is no more needed because C++11
supports them natively in <cstdint>

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Merge from master
Be sure we have at least one detected cpu

Issue reported by Heinz van Saanen that says:
"the doc says that std::thread::hardware_concurrency()
returns 0 when finding no plausible number (or
implemented as dummy in my old GCC)."

No functional change.
Specify enum underlying type

And retire our hacks to force integers in
enums.

No functional change.
Use std::unique_ptr to store Endgames

Instead of the old std::auto_ptr, this new std::unique_ptr
is designed to be used inside STL containers like are
our endgames maps.

We can now get rid of explicitly deleting the endgames
objects in ~Endgames, the smart pointer will take care
of it upon its destruction.

No functional change.
Endgames: further push the pedal on metaprogramming

Experiment with the new 'features'. Ok this is not
really needed, just toying a little bit :-)

A compiler should be quite conforming to the new C++11
standard to workout through this!

No functional change.
Futher touches to endgames.h

Also sliglthly changed probe() signature to make it clear
from the caller we are going to modify the passed pointer.

No functional change.
Enjoy lambdas in ucioption.cpp

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Use initializer lists in benchmark.cpp

And get rid of hard coded size.

No functional change.
Merge branch 'master' into c++11
Prefer unique_ptr to auto_ptr

We still need the move semantic of auto_ptr, but with
unique_ptr we can make it explicit with std::move().

Suggested by Rein that says:
So std::unique_ptr makes the move semantics explicit, which is a good
thing because it documents the effects more clearly. IMO, there are no
real uses for std::auto_ptr anymore that std::unique_ptr cannot do at
least as well. IIRC, the std committee has marked auto_ptr as deprecated
(which means it can be removed in future versions, so code shouldn't rely
on it).

No functional change.
Use range-based for-loop

No functional change.
Use initializers list in square_to_string()

This is a nice one !

No functional change.