Last active
October 9, 2015 02:58
-
-
Save lucasnlm/3427850 to your computer and use it in GitHub Desktop.
endl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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