impl-trait-for-tuples icon indicating copy to clipboard operation
impl-trait-for-tuples copied to clipboard

No apparent way to access the tuple size/index as a literal

Open CraftSpider opened this issue 3 years ago • 2 comments
trafficstars

I find this macro handy for tuple implementations, but have bumped into two related issues:

  1. Accessing the tuple size as a literal. This is useful if one wants, say, an array of the same size as the elements in the tuple as a type
  2. Accessing the current tuple index as a literal in a repetition. Basically, the ability to print out 'accessing tuple index N'

CraftSpider avatar Jan 05 '22 19:01 CraftSpider

Hey, do you have any ideas how the syntax could look for each of them?

bkchr avatar Feb 06 '22 08:02 bkchr

If nothing nicer, may be possible to support #length in for_tuples and #index in repetitions.

CraftSpider avatar Feb 07 '22 01:02 CraftSpider