Loading...   


template <typename T>
struct Gumby {
	static inline const std::size_t size() { return sizeof(T); }
};

template <typename T>
struct Pingo {
	static inline const bool pie() { return false; }
};

struct JellyA {
	int a = 2;
	int b = 4;
};

struct JellyB : public Pingo<JellyB> {
	int a = 2;
	int b = 4;
};

struct JellyC : public Gumby<JellyC> {
	int a = 2;
	int b = 4;
};

struct JellyD : public Pingo<JellyD>, public Gumby<JellyD> {
	int a = 2;
	int b = 4;
};

void main() {
	std::cout << "JellyA " << sizeof(JellyA) << std::endl;
	std::cout << "JellyB " << sizeof(JellyB) << std::endl;
	std::cout << "JellyC " << sizeof(JellyC) << std::endl;
	std::cout << "JellyD " << sizeof(JellyD) << std::endl; // WTF
}

Raw Paste Data