Created
November 12, 2017 16:13
-
-
Save phrocker/100a0806fbc188731358b659c7cf63ab to your computer and use it in GitHub Desktop.
Property Example
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 <memory> | |
#include <string> | |
#include <iostream> | |
class Property{ | |
public: | |
virtual const std::string &getValue() __attribute__ ((always_inline)); | |
std::string value; | |
std::string key; | |
}; | |
const std::string &Property::getValue(){ | |
return value; | |
} | |
int main(int argc, char** argv){ | |
Property prop; | |
prop.value = "hi"; | |
std::string other = prop.getValue(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment