Relative Content

Tag Archive for c++11

Pthread, C2X, and C++11 thread (in)compatibility

As my next spare-time project, I’m considering writing a suite of compatibility header and associated library, that eases the transition from Single Unix Specification v4 to v5 and C11/C17 to C2X. C++ will not be my concern, but it adds to the discussion.

about details of accumulate transofrm in c++11

I encountered some problems when learning the accumulate function of c++11:
I know that the third parameter of this function needs to receive a clear type and act on the calculation. I tried to let it use the default int type for testing so as to observe the type conversion that occurs. As shown below, I use 0 as the third parameter input, hoping that it will recognize the sum type as int. I expect the calculation process should be (-9) + (3) = -6

Intersection of geometric entities

I was trying to design a small C++ geometric API for learning purposes, but came across a problem when dealing with intersections of geometric entities. For example, the intersection of a line and a sphere can have three different types: a couple of points, a point or nothing at all. I found several ways to deal with this problem, but I don’t know which of them seems to be the best:

Documenting the effect of std::move

As my team move towards embracing the new features in C++11, I’m struggling with how to make the side-effects of std::move self-documenting in the code.

Documenting the effect of std::move

As my team move towards embracing the new features in C++11, I’m struggling with how to make the side-effects of std::move self-documenting in the code.

Documenting the effect of std::move

As my team move towards embracing the new features in C++11, I’m struggling with how to make the side-effects of std::move self-documenting in the code.