Hacker News new | past | comments | ask | show | jobs | submit login

Well, my memory was a bit wrong (it's been about 6 years since I last looked at this), and it's not as bad as I remember. It's not great, mind you, but here are the binary sizes for a simple program:

Boost Lambda (unstripped): 44176 bytes

Boost Lambda (stripped): 18808 bytes

C++11 Lambda (unstripped): 24896 bytes

C++11 Lambda (stripped): 14712 bytes

Test program is pretty simple:

  #include <algorithm>
  #include <iostream>
  #include <vector>
  #include <boost/lambda/lambda.hpp>

  using namespace boost::lambda;

  int main(int, const char**)
  {
    std::vector<int> v;

    for (int i = 0; i < 100; ++i)
      v.push_back(i);

    //std::for_each(std::begin(v), std::end(v), std::cout << _1 << constant('\n'));

    std::for_each(std::begin(v), std::end(v), [](int i) { std::cout << i << '\n'; });

    return 0;
  }
I'm using Boost 1.58.0 and GCC 5.4.0 with -std=c++1y flag only to get the numbers above.

(edit: formatting)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: