Created
February 24, 2013 20:30
-
-
Save erincandescent/5025486 to your computer and use it in GitHub Desktop.
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
template<typename T, T V> | |
class get_member; | |
template<typename Class, typename T, T Class::* Pointer> | |
class get_member<T Class::*, Pointer> | |
{ | |
public: | |
inline T& operator()(Class& c) | |
{ | |
return c.*Pointer; | |
} | |
inline const T& operator()(const Class& c) | |
{ | |
return c.*Pointer; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment