Compare commits
5 commits
e1d1138653
...
eb41bede5e
Author | SHA1 | Date | |
---|---|---|---|
|
eb41bede5e | ||
|
c55321e6f1 | ||
|
b5bb0bc2ca | ||
|
022dffc9a4 | ||
|
0a18980aa3 |
13 changed files with 115 additions and 131 deletions
2
Makefile
2
Makefile
|
@ -18,7 +18,7 @@ clean:
|
||||||
done
|
done
|
||||||
|
|
||||||
format:
|
format:
|
||||||
find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -exec clang-format -i {} \;
|
find . -type f \( -name "*.cc" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -exec clang-format -i {} \;
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build clean test format
|
.PHONY: build clean test format
|
||||||
|
|
12
junk/1.cc
12
junk/1.cc
|
@ -4,16 +4,16 @@ using std::cout;
|
||||||
|
|
||||||
// Rule of three:
|
// Rule of three:
|
||||||
// If a class requires a user-defined destructor, a user-defined copy
|
// If a class requires a user-defined destructor, a user-defined copy
|
||||||
// constructor, or a user-defined copy assignment operator, it almost certainly
|
// constructor, or a user-defined copy assignment operator, it almost
|
||||||
// requires all three.
|
// certainly requires all three.
|
||||||
//
|
//
|
||||||
|
|
||||||
// Rule of five:
|
// Rule of five:
|
||||||
// Because the presence of a user-defined (include = default or = delete
|
// Because the presence of a user-defined (include = default or = delete
|
||||||
// declared) destructor, copy-constructor, or copy-assignment operator prevents
|
// declared) destructor, copy-constructor, or copy-assignment operator
|
||||||
// implicit definition of the move constructor and the move assignment operator,
|
// prevents implicit definition of the move constructor and the move
|
||||||
// any class for which move semantics are desirable, has to declare all five
|
// assignment operator, any class for which move semantics are desirable, has
|
||||||
// special member functions:
|
// to declare all five special member functions:
|
||||||
|
|
||||||
struct A {
|
struct A {
|
||||||
A() = default;
|
A() = default;
|
||||||
|
|
|
@ -14,6 +14,4 @@ void use2() {
|
||||||
consume_number(&i);
|
consume_number(&i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) { use2(); }
|
||||||
use2();
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
template <typename InputIt, typename OutputIt, typename Pred>
|
template <typename InputIt, typename OutputIt, typename Pred>
|
||||||
std::pair<InputIt, OutputIt> copy_while(InputIt first, InputIt last,
|
std::pair<InputIt, OutputIt> copy_while(InputIt first, InputIt last,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
template <typename T> class User {
|
template <typename T> class User {
|
||||||
T id;
|
T id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit User(T n) : id(n) {}
|
explicit User(T n) : id(n) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
5
template/Makefile
Normal file
5
template/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Only define if needed:
|
||||||
|
# TARGET = main.elf
|
||||||
|
# SRCS = main.cc
|
||||||
|
|
||||||
|
include ../config.mk
|
3
template/main.cc
Normal file
3
template/main.cc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main() { std::cout << "Template" << std::endl; }
|
|
@ -1,6 +0,0 @@
|
||||||
TARGET = main.elf
|
|
||||||
SRCS = main.cc
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
include ../config.mk
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::cout << "Hola" << std::endl;
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
TARGET = main.elf
|
|
||||||
SRCS = main.cc
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
include ../config.mk
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::cout << "Hola" << std::endl;
|
|
||||||
}
|
|
Loading…
Reference in a new issue