Last active
August 29, 2015 14:19
-
-
Save hdznrrd/274c5a512f7875483391 to your computer and use it in GitHub Desktop.
This file contains 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
$ echo "++HEADER";cat test.h; echo "++IMPL"; cat test.cpp;(CXXFLAGS=--std=c++11 make test && ./test) | |
++HEADER | |
#ifndef _TEST_H_ | |
#define _TEST_H_ | |
class foo { | |
public: foo(int a=1); | |
}; | |
#endif | |
++IMPL | |
#include "test.h" | |
#include <iostream> | |
foo::foo(int a/*=1*/) { | |
std::cout << a << std::endl; | |
} | |
int main(int argc, char** argv) { | |
foo(); | |
foo(2); | |
return 0; | |
} | |
g++ --std=c++11 test.cpp -o test | |
1 | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment