kgashok / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

C++0x #152

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I propose start using C++0x standard. It has a lot of new mechanism which make 
easier translate python to C++. For example: tuples, auto type, new for loop.

Original issue reported on code.google.com by miros1...@gmail.com on 3 Sep 2011 at 7:30

GoogleCodeExporter commented 8 years ago
thanks for the suggestion. I agree! variadic templates are probably most useful 
for shedskin.

but the thing is, many shedskin users are still on older versions of GCC (OSX, 
debian stable..). so I don't know if we want to depend on C++0x at this point. 
that will come, though! :)

Original comment by mark.duf...@gmail.com on 3 Sep 2011 at 12:37

GoogleCodeExporter commented 8 years ago
I think if users get Shedskin with a lot of new features, they will want 
install new version of GCC.

Original comment by miros1...@gmail.com on 5 Sep 2011 at 6:32

GoogleCodeExporter commented 8 years ago
sorry for the late reply. 

I don't think there will be lots of new features, just a bit of performance 
improvements here and there (mostly because variadic templates make boxing 
unnecessary). 

Original comment by mark.duf...@gmail.com on 10 Sep 2011 at 10:21

GoogleCodeExporter commented 8 years ago
Well, lambdas can be used to implement closures, and std::function has uses, 
too:

std::function<int(int)> f(int v)
{
    std::function<int(int)> myfunc = [&](int a)->int { return v; };
    return myfunc;
}

auto res = f();
std::cout << res(7) << std::endl; // prints 7

Original comment by Rym...@gmail.com on 11 Apr 2014 at 7:47