Last active
August 29, 2015 14:21
-
-
Save sh1boot/b175d1c70039990c236b to your computer and use it in GitHub Desktop.
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
#include <stdint.h> | |
class Foo { | |
uint64_t& data; | |
uint64_t* const pdata; | |
public: | |
Foo(uint64_t& d) : data(d), pdata(&d) { } | |
inline uint64_t get(void) { return data; } | |
inline uint64_t pget(void) { return *pdata; } | |
}; | |
class Bar : public Foo { | |
uint64_t mine; | |
public: | |
Bar(void) : Foo(mine) { } | |
uint64_t getget(void) { return get(); } | |
uint64_t pgetget(void) { return pget(); } | |
uint64_t justget(void) { return mine; } | |
}; | |
uint32_t fn(Bar &b) { | |
return b.getget(); | |
} | |
uint32_t pfn(Bar &b) { | |
return b.pgetget(); | |
} | |
uint32_t fn1(Bar &b) { | |
return b.justget(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment