Created
January 31, 2014 12:03
-
-
Save merf/8730815 to your computer and use it in GitHub Desktop.
Can't figure out whats wrong here...
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
//I often want to typedef shared_pts to classes like: | |
typedef std::shared_ptr<CThing> TThingPtr; | |
//Figured it'd be easy to wrap this in a macro like: | |
#define SHARED_PTR(Name) typedef std::shared_ptr<C##Name> T##NamePtr; | |
//but: | |
SHARED_PTR(Thing) | |
TThingPtr p; //ERROR: Unknown type TThingPtr | |
//and: | |
SHARED_PTR(Thing1) | |
SHARED_PTR(Thing2) //ERROR: Typedef redefinition with different types ('shared_ptr<class CThing1>' vs 'shared_ptr<class CThing2>') | |
//??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment