Guest User

Untitled

a guest
Jun 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. template < class T > class XVector < T >
  2. {
  3. ...
  4. template < class T > T
  5. XVector < T >::getIncrement ()
  6. {
  7. ...
  8. }
  9. template < class T > int
  10. XVector < T >::getValue (size_t index, T& value)
  11. {
  12. ...
  13. //The problematic line
  14. value = (T) (first_value + getIncrement())
  15. * (long) (index - first_index);
  16. ....
  17. }
  18. }
  19.  
  20. class TypeValue
  21. {
  22. union
  23. {
  24. long* _int_value;
  25. double* _real_value;
  26. string* _text_value;
  27. } _value;
  28.  
  29. TypeValue();
  30. explicit TypeValue(long _long);
  31. explicit TypeValue(int _int);
  32. explicit TypeValue(unsigned long _ulong);
  33. ...
  34. //similarly for all the remaining supported types.
  35. TypeValue(const TypeValue& ) //Copy constructor
  36.  
  37. virtual TypeValue& operator=(const TypeValue &rhs);
  38. TypeValue& operator+ (TypeValue& )const;
  39. TypeValue& operator* (TypeValue& )const;
  40. ...
  41. //For all the basic operators
  42.  
  43. operator long() const;
  44. operator int() const;
  45. operator unsigned long() const;
  46. operator unsigned int() const;
  47. ...
  48.  
  49. }
  50.  
  51. long [int]
  52.  
  53. operator long() const;
  54.  
  55. long ToLong() const;
Add Comment
Please, Sign In to add comment