Saturday, August 9, 2014

Thursday, November 14, 2013

Tuesday, October 29, 2013

Tuesday, August 20, 2013

Boost at nuget.org

It's unofficial but it works https://www.nuget.org/packages/boost/. For Visual Studio 2012, supported platforms: Win32 and x64.

It's huge 235Mb and takes about half an hour to install.

  1. Open your C++ project. Or create a new one.
  2. Open Tools | Library Package Manager | Manage NuGet Packages for Solution....
  3. Search for "boost" in Online | NuGet Official Package Source (Include Prerelease).
  4. Press the Install button.
  5. Wait for about 10 minutes.
  6. Select your C++ project and press Ok.
  7. Wait for another 10 minutes.
  8. Close the dialogs.
  9. Include some boost header files. For example: #include <boost/atomic.hpp>
  10. Build the project.

Update

The updated boost package doesn't contain compiled libraries (.lib/.dll) any more. Now it's only 15Mb. I've created separate packages for the boost compiled libraries:

Sunday, February 13, 2011

Nemerle at Wikipedia.

The article about Nemerle has been removed from Wikipedia as a non-notable programming language.

Tuesday, February 1, 2011

INumeric policy.

Policies:
interface INumericPolicy<T>
{
    T Zero();
    T Add(T a, T b);
    ...
}

class All: INumericPolicy<int>, INumericPolicy<long>, ...
{
    ...
    public static All P = new All();
}
User's algorithms:
static class Algorithms
{
    public static T Sum<P, T>(this P p, params T[] a)
        where P: INumericPolicy<T>
    {
        var r = p.Zero();
        foreach(var i in a)
        {
            r = p.Add(r, i);
        }
        return r;
    }

    ...
}
Usage:
int i = All.P.Sum(1, 2, 3, 4, 5);
long l = All.P.Sum(1L, 2, 3, 4, 5);