Aviv Callander Yes, it is possible.

You can replace the below code.

But the limitation here is you don’t have the access to the variables passed in isMultipleOf method as an argument from the method call (5 in our case).

There is even another way where you can call a method by its reference but that won’t work in our case.

If we try to call isMultipleOf method with this approach, there will be a type miss-match issue as isMultipleOf method expects int as its first parameter whereas the data type we have in our filterOnCondition method is of Template <T> type.




Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store