-1

I've been looking at some open-source code using the eigen library for numerical computations, but I can't wrap my head around what this last line of code does:

        output.device(device) =
            input.template fft<Eigen::BothParts, direction>(axes);

There are no parentheses that indicate "template" is a function being called, however VSCode colors it teal as if it's a method? Inside the eigen source code, I can't see this method defined anywhere. How does this work?

David McNamee
  • 389
  • 3
  • 9
  • 1
    Here `template` is used to indicate that the method `fft` is a template. It is used when `input`'s type is unknown, i.e., some generic type. – ALX23z May 07 '22 at 06:37
  • 1
    Mentally put a space between the `.` and `template`; they are two separate things. In fact, it's `template fit` that matters. – Pete Becker May 07 '22 at 13:04

0 Answers0