Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience for programmers using lambda expression #9

Closed
leoisl opened this issue Jul 18, 2016 · 2 comments
Closed

Convenience for programmers using lambda expression #9

leoisl opened this issue Jul 18, 2016 · 2 comments
Assignees

Comments

@leoisl
Copy link

leoisl commented Jul 18, 2016

Hello!

I'd like to know if it is possible to change the signature or to add another iterator() function in gatb::core::tools::dp::Iterator class. I guess this class is used a lot when programming in GATB, but we can't use it with lambda expressions. Right now, this function is defined as:

template <typename Functor> void iterate (/* R: removed const for convenience */ /*const*/ Functor& f) { for (first(); !isDone(); next()) { f (item()); } }

As the parameter is not const anymore, it is not possible to use this function with lambda expressions, which is convenient for those using c++11. For those using versions below c++11, however, the function seems more convenient as it is now...

This is not a big deal though...

@rchikhi
Copy link
Member

rchikhi commented Jul 19, 2016

yep let me see if removing that const is still needed in the current code. Will update you asap.

@rchikhi
Copy link
Member

rchikhi commented Jul 20, 2016

seems that the functor could simply be made const safely in the current code. so, please checkout the current master branch, the fix will appear in the next release (1.2.3)

@rchikhi rchikhi closed this as completed Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants