Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

CPP

Name: Anonymous 2011-11-27 10:04

Hi,

is it a good practice to write this #def in cpp?

#define print(X) std::cout<<X<<std::endl

so that it can be used as:

print("what " << "ever" << " I " << "want");

btw.. how do I insert sniplet of code here?

Name: Anonymous 2011-11-27 16:40

holy shit the autism in this thread

>>1-san: Why do you use macros in C++? Are you autistic? No, don't answer that, you clearly are.

here's the non-autismal-as-fuck version:

template<typename Stream, typename Type>
void print(Stream st, Type item)
{
    st << item << std::endl;
}

template<typename Type>
void print(Type item)
{
    print(std::cout, item);
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List