Consultation needed
Closed this issue · 4 comments
NSkeledzija commented
I'm having troubles installing yavide on my laptop and am currently in your area. Would you like to meet up in the Vintage Industrial Bar?
jmiskovic commented
That's actually a very good idea. We should organise a support session there, or in BBF.
JBakamovic commented
#include <iostream>
template<int N>
struct beer {
inline static void drink() {
std::cout << N << " bottles of beer on the wall, "
<< N << " bottles of beer.\nTake one down, pass it around, "
<< N - 1 << " bottles of beer on the wall.\n\n";
beer<N - 1>::drink();
}
};
template<>
struct beer<1> {
inline static void drink() {
std::cout << "1 bottle of beer on the wall, 1 bottle of beer.\n"
<< "Take it down and pass it around, no more bottles of beer on the wall.\n\n"
<< "No more bottles of beer on the wall, no more bottles of beer.\n"
<< "Go to the store and buy some more, 99 bottles of beer on the wall.\n";
}
};
template<>
struct beer<2> {
inline static void drink() {
std::cout << "2 bottles of beer on the wall, "
<< "2 bottles of beer.\nTake one down, pass it around, "
<< "1 bottle of beer on the wall.\n\n";
beer<1>::drink();
}
};
int main() {
beer<99>::drink();
return 0;
}
JBakamovic commented
Try this and let me know if it helps or not.
NSkeledzija commented
Thank you, it works! I tested this solution and forgot about my original issue, as well some other ones too.