Created
February 1, 2020 07:15
-
-
Save mattfysh/bf9ab0fea139fca0390cffba0c3c5a9b to your computer and use it in GitHub Desktop.
Runtime symbols
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
#include <iostream> | |
using namespace std; | |
template<typename T> | |
T make_symbol(T value, string metadata); | |
template<typename T> | |
string get_symbol_for(T value); | |
void printString(string str) { | |
cout << str << endl; | |
string metadata = get_symbol_for(str); | |
cout << metadata << endl; | |
} | |
int main() { | |
string greeting = make_symbol("hello", "xyz"); | |
printString(greeting); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment