vitimiti

Tests

Dec 11th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.37 KB | None | 0 0
  1. // All <Matium> keywords ar subject to change, this is half assed code that
  2. // isn't meant to compile.
  3.  
  4. ///////////////////////////////////////////////////////////////////////////////
  5. // File: <Matium>Standards, what you DO NOT see.
  6. namespace <Matium> {
  7. namespace Standard {
  8. namespace Unsigned {
  9. using Integer8 = unsigned char; // This is also a single byte.
  10. using Integer16 = unsigned short; // This is an unsigned integer of 16 bytes.
  11. using Integer32 = unsigned int; // This is an unsigned integer of 32 bytes.
  12. using Integer64 = unsigned long; // This is an unsigned integer of 64 bytes.
  13.  
  14. Integer8 Integer8(Integer8 Value) { return Value; }
  15. Integer16 Integer16(Integer16 Value) { return Value; }
  16. Integer32 Integer32(Integer32 Value) { return Value; }
  17. Integer64 Integer64(Integer64 Value) { return Value; }
  18. }
  19.  
  20. using Integer16 = short; // This is an integer of 16 bytes.
  21. using Integer32 = int; // This is an integer of 32 bytes.
  22. using Integer64 = long; // This is an integer of 64 bytes (biggest ones).
  23.  
  24. Integer16 Integer16(Integer16 Value) { return Value; }
  25. Integer32 Integer32(Integer32 Value) { return Value; }
  26. Integer64 Integer64(Integer64 Value) { return Value; }
  27.  
  28. using Byte = unsigned char; // This is one byte.
  29. using Character = char; // I really think saying "Character" is clearer.
  30.  
  31. Byte Byte(Byte Value) { return Value; }
  32. Character Character(Character Value) { return Value; }
  33.  
  34. using Variable = auto;
  35.  
  36. }
  37. }
  38. ///////////////////////////////////////////////////////////////////////////////
  39.  
  40. // How to use it, what you see:
  41. <Matium>::Standard::Variable Red = <Matium>::Standard::Byte(0xFF);
  42. <Matium>::Standard::Variable A = <Matium>::Standard::Character("A");
  43. <Matium>::Standard::Variable Number3 = <Matium>::Standard::Unsigned::Integer16(3);
  44. <Matium>::Standard::Variable Number8 = <Matium>::Standard::Unsigned::Integer8(8);
  45. <Matium>::Standard::Variable BigNumber = <Matium>::Standard::Integer64(1000232123);
  46. <Matium>::Standard::Integer32 Status = 0; // The classic way with the equals.
  47. using namespace Matium;
  48. Standard::Integer32 Thing = 0; // Or you can be a dickhead and not see my namespace again :^)
  49. Standard::Integer32 Ting = Standard::Integer32(1); // Messy, ain't it? That's why I have "Variable".
  50. // Or you can keep going.
  51. using namespace Matium::Standard;
  52. Iteger32 Statusion = 1;
  53. Variable M8 = Integer32(8/8); // And play around with calculations, of course.
Advertisement
Add Comment
Please, Sign In to add comment