Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. struct TypeId
  2. {
  3. unsigned char myTypeId;
  4.  
  5. // Comment out this line and it links incrementally
  6. TypeId() : myTypeId(0) {}
  7. };
  8.  
  9. template<class Type>
  10. struct TypeRegistrationHelper
  11. {
  12. static TypeId ourTypeId;
  13. };
  14.  
  15. template<class Type> TypeId TypeRegistrationHelper<Type>::ourTypeId;
  16.  
  17. // Uncomment this line and it links incrementally
  18. //template struct TypeRegistrationHelper<float>;
  19.  
  20. void UpdateFrame()
  21. {
  22. // Commenting/uncommenting this line causes a full link to happen
  23. // unless you have changed 1 of the 2 lines listed above. Then it links
  24. // incrementally as expected when changing this line.
  25. TypeRegistrationHelper<float>::ourTypeId;
  26. }
  27.  
  28. #include "Updater.h"
  29.  
  30. int main()
  31. {
  32. UpdateFrame();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement