Skip to content

Instantly share code, notes, and snippets.

@lucasnlm
Last active October 9, 2015 02:58
Show Gist options
  • Save lucasnlm/3427850 to your computer and use it in GitHub Desktop.
Save lucasnlm/3427850 to your computer and use it in GitHub Desktop.
endl
#include <iostream>
#ifdef NDEBUG
inline std::ostream& finish(std::ostream& os)
{
return (os << std::endl);
}
#else
inline std::ostream& finish(std::ostream& os)
{
return (os << '\n');
}
#endif
using namespace std;
int main(int argc, char** argv)
{
cout << "Line 1" << finish << "Line 2" << finish;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment