| Joel Uckelman on 18 Oct 2003 15:54:19 -0000 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: [hosers-talk] ode to de morgan and his law |
Jon, can you say in 100 words or less what this does? I don't want to
have to get boost and try it, or read the boost docs to find out.
Thus spake "Jon Stewart":
> C++. E.g.:
>
> #include <iostream>
> #include <vector>
> #include <iterator>
> #include <algorithm>
>
> #include <boost/lambda/lambda.hpp>
>
> using namespace boost::lambda;
> using namespace std;
>
> template<class FnT>
> class Converter {
> public:
> Converter(FnT& f) : fn(f) {}
> operator int() const { return fn(); }
>
> private:
> FnT& fn;
> };
>
> template<class FnT>
> auto_ptr< Converter<FnT> > MakeConverter(FnT& f)
> {
> auto_ptr< Converter<FnT> > ptr(new Converter<FnT>(f));
> return ptr;
> }
>
> int main(int argc, char *argv[])
> {
> vector<int> vec;
> int i(0);
> fill_n(back_inserter(vec), 20, *MakeConverter(var(i)++));
> for_each(vec.begin(), vec.end(), cout << _1 << '\n');
>
> return EXIT_SUCCESS;
> }
>
> It's cool shit.
>
> Here's a quote:
>
> Disbelief in the Devil is a French idea.
>
> -- Fyodor Dostoevsky
>
>
> Fucking Cubs.
>
>
>
> Jon
> --
> Jon Stewart Advanced Los Angeles C++
> stew1@xxxxxxxxxxx http://www.alacpp.org
> _______________________________________________
> hosers-talk mailing list
> hosers-talk@xxxxxxxxxxx
> http://lists.ellipsis.cx/mailman/listinfo/hosers-talk
>
_______________________________________________
hosers-talk mailing list
hosers-talk@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/hosers-talk