Skip to content

Instantly share code, notes, and snippets.

@phrocker
Created November 12, 2017 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phrocker/100a0806fbc188731358b659c7cf63ab to your computer and use it in GitHub Desktop.
Save phrocker/100a0806fbc188731358b659c7cf63ab to your computer and use it in GitHub Desktop.
Property Example
#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