Advertisement
EddyLuten

Untitled

Oct 18th, 2011
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. // Windows crap, no pimpl
  2. class MyThing
  3. {
  4.   HMODULE this_thing;
  5.   HICON that_thing;
  6. public:
  7.   DoCrap();
  8. };
  9.  
  10. // Unix crap no pimpl
  11. class MyThing
  12. {
  13.   FILE this_thing;
  14.   void* that_thing;
  15. public:
  16.   DoCrap();
  17. };
  18.  
  19. // PIMPL:
  20. class MyThing
  21. {
  22.   struct MyThingImplementation;
  23.   MyThingImplementation* m_Pimpl;
  24.  
  25. public:
  26.   DoCrap();
  27. };
  28.  
  29. // now you have different CPP files for win/nix, which is ok. m_Pimpl size is same across platforms sizeof(pointer type), pretty much always 4 bytes.
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement