All pastes #375015 Raw Copy code Copy link Edit

Stuff

public unlisted text v1 · immutable
#375015 ·published 2007-02-27 22:52 UTC
rendered paste body
#include <iostream>
using namespace std;

template<int i, int j, int k>
struct Y {
    Y() { cout << i << endl; } };

template<int i> 
struct Y<i,0,1> { Y() {
    cout << "buzz" << endl; } };

template<int i> 
struct Y<i,1,0> {
    Y() { cout << "fizz" << endl; } };

template<int i> 
struct Y<i,1,1> {
Y() { cout << "fizzbuzz" << endl; } };

template<int i>
struct X : public X<i-1>{
    struct Y<i, i%3==0,i%5==0> y;
};  

template<>
struct X<0> {
};

int main(void) {
    X<100> x;
}