Last active
July 24, 2017 05:11
-
-
Save anhldbk/7febe8ea87dceccc3b8772a36b5a3ed7 to your computer and use it in GitHub Desktop.
C++ tricks
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
#define Data_T(type) template <typename T> type Data<T> | |
template<typename T> | |
class Data { | |
private: | |
T _data; | |
public: | |
Data(T data); | |
void show(); | |
}; | |
Data_T()::Data(T data) : _data(data) {} | |
Data_T(void)::show() { | |
cout << this->_data << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Function pointer: