[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 10fe7307c3 291/323: Get a better C++ starter
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 10fe7307c3 291/323: Get a better C++ starter example |
Date: |
Thu, 9 Mar 2023 10:58:45 -0500 (EST) |
branch: externals/beardbolt
commit 10fe7307c3b25ffa15fd28f459c691032f85032f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Get a better C++ starter example
---
starters/beardbolt.cpp | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/starters/beardbolt.cpp b/starters/beardbolt.cpp
index 0c425d90c1..30582dc150 100644
--- a/starters/beardbolt.cpp
+++ b/starters/beardbolt.cpp
@@ -1,29 +1,26 @@
#include <iostream>
+#include <array>
+#include <vector>
+#include <span>
-// C++ beardbolt starter file
-
-// Local Variables:
-// beardbolt-command: "g++ -O3"
-// rmsbolt-command: "g++ -O3"
-// beardbolt-kill-symbol-re: "\\(^_Z[^0-9]*[SP]\\|__gnu\\)"
-// beardbolt-disassemble: nil
-// End:
-
-int isRMS(int a) {
- switch (a) {
- case 'R':
- return 1;
- case 'M':
- return 2;
- case 'S':
- return 3;
- default:
- return 0;
- }
+template <typename F, typename T >
+void bubble(F from, T to) {
+ for (auto i = from; i < to - 1; i++)
+ for (auto j = to - 1; i < j; j--)
+ if (*j < *(j - 1))
+ std::swap(*j, *(j - 1));
}
int main() {
- char a = 1 + 1;
- if (isRMS(a))
- std::cout << a << std::endl;
+ std::array a{5, 2, 1, 4, 2};
+ bubble(a.begin(), a.end());
+
+ std::cout << " Sorted array : ";
+ for (const auto& e : a) std::cout << e << "\n";
+ return 0;
}
+
+// Local Variables:
+// beardbolt-command: "g++ -std=c++20 -O3"
+// beardbolt-kill-symbol-re: "\\(^_Z[^0-9]*[SP]\\|__\\)"
+// End:
- [elpa] externals/beardbolt 041234b499 241/323: Improve auto-compilation, (continued)
- [elpa] externals/beardbolt 041234b499 241/323: Improve auto-compilation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2421b29094 255/323: Remove .ert-runner, .gitlab-ci.yml and Cask, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 49e2500be1 259/323: Use shorthands so I can just type bb- instead of beardbolt-, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 58b07a215c 268/323: Simplify some code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9f6d1cf10c 269/323: Remove some rmsbolt remnants, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 291f82a324 266/323: Continue rewriting, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a13f8fe7f4 287/323: Reset beardbolt-specific locals before hacking them in, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 85d24d69f1 286/323: Add bb-kill-symbol-re option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 10fe7307c3 291/323: Get a better C++ starter example,
ELPA Syncer <=
- [elpa] externals/beardbolt 5324775417 321/323: Add beardbolt-shuffle-rainbow option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 90b5cad9c1 016/323: Finish initial implementation of dissasembly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt de183bea12 010/323: Add support for c++ and c, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 627dd4c1c9 059/323: Allow for custom asm processing functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 978d8290a1 067/323: Add guide on adding new languages, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f911321a02 058/323: Add support for automatically hot recompiling, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 86742e7b76 055/323: Merge branch 'master' of gitlab.com:jgkamat/rmsbolt, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 01f7664eda 060/323: Fix tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 36b701d70e 072/323: Fix broken tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8d992d1da7 103/323: Add links to README, ELPA Syncer, 2023/03/09