Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Conversation

@phimuemue
Copy link

@phimuemue phimuemue commented Apr 15, 2018

I saw the comment at https://github.com/csherratt/tuple_utils/blob/master/src/lib.rs#L129 and thought that we could replace all those manual impls with ones created by macro loops.

Basically, I delegated the work to two macros:

  • Essentailly, for_each_prefix takes a macro and a list of arguments and applies the macro to all prefixes of the argument list.
  • for_each_prefix_suffix does something similar, but applies the given macro to the suffixes, too.

For simplicity, I always used trailing commas in the macros. In addition, I replaced type names A, B, C... with T0, T1, T2....

@csherratt csherratt merged commit 65dcac7 into csherratt:master Nov 23, 2018
@csherratt
Copy link
Owner

Thanks! Sorry I missed this pull request and let it sit for so long. It's appreciated.

@phimuemue
Copy link
Author

No worries!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants