summaryrefslogtreecommitdiff
path: root/2p38.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-07-31 17:09:45 +0200
committerOskar <[email protected]>2024-07-31 17:09:45 +0200
commita450487a18ec72ea3a3815bfaf17b2f701796b6f (patch)
tree67b4cfe127bc5c134f06c06e57ad35629e630b7b /2p38.cpp
parentb7819b597e1241dd98643eeda4c288a341142311 (diff)
more
Diffstat (limited to '2p38.cpp')
-rw-r--r--2p38.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/2p38.cpp b/2p38.cpp
new file mode 100644
index 0000000..dbaaf0d
--- /dev/null
+++ b/2p38.cpp
@@ -0,0 +1,28 @@
+#include <iostream>
+#include "sales_item.hpp"
+
+/*
+ *
+ * 2.38
+ * auto ignores toplevel const and reference
+ * decltype included toplevel const and reference
+ */
+
+int main () {
+
+ int i = 109; //int
+ int *pi = &i; //int*
+ const int ff = 1; // const int
+
+ auto ffi = ff; //int
+ decltype(ff) ffd = 100; //const int
+ auto ai = *pi; // int
+ decltype(*pi) di = i; //int&
+
+ std::cout << ai << " " // 109
+ << di << " " // 109
+ << ffi << " " // 1
+ << ffd << " " // 100
+ << std::endl;
+ return 0;
+}