メモだけ

#include <iostream>

using namespace std;

template <int N, int _3 = N % 3, int _5 = N % 5>
struct FizzBuzz {
  FizzBuzz() {
    FizzBuzz<N - 1>();
    cout << N << " ";
  }
};

template <int N, int _5>
struct FizzBuzz<N, 0, _5> {
  FizzBuzz() {
    FizzBuzz<N - 1>();
    cout << "Fizz ";
  }
};

template <int N, int _3>
struct FizzBuzz<N, _3, 0> {
  FizzBuzz() {
    FizzBuzz<N - 1>();
    cout << "Buzz ";
  }
};

template <int N>
struct FizzBuzz<N, 0, 0> {
  FizzBuzz() {
    FizzBuzz<N - 1>();
    cout << "FizzBuzz ";
  }
};

template <>
struct FizzBuzz<0> {
};

int main() {
  FizzBuzz<100>();
  cout << endl;
}