Compare commits

..

No commits in common. "eb41bede5e5e0a1f351636ca075c664fb51a5b69" and "e1d1138653907c9ce33394b97f9a310ba9da81e8" have entirely different histories.

13 changed files with 131 additions and 115 deletions

View file

@ -18,7 +18,7 @@ clean:
done done
format: format:
find . -type f \( -name "*.cc" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -exec clang-format -i {} \; find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -exec clang-format -i {} \;
.PHONY: build clean test format .PHONY: build clean test format

View file

@ -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 // constructor, or a user-defined copy assignment operator, it almost certainly
// certainly requires all three. // 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 // declared) destructor, copy-constructor, or copy-assignment operator prevents
// prevents implicit definition of the move constructor and the move // implicit definition of the move constructor and the move assignment operator,
// assignment operator, any class for which move semantics are desirable, has // any class for which move semantics are desirable, has to declare all five
// to declare all five special member functions: // special member functions:
struct A { struct A {
A() = default; A() = default;

View file

@ -14,4 +14,6 @@ void use2() {
consume_number(&i); consume_number(&i);
} }
int main(int argc, char *argv[]) { use2(); } int main(int argc, char *argv[]) {
use2();
}

View file

@ -1,6 +1,6 @@
#include <iostream> #include <iostream>
#include <ranges>
#include <vector> #include <vector>
#include <ranges>
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,

View file

@ -1,5 +0,0 @@
# Only define if needed:
# TARGET = main.elf
# SRCS = main.cc
include ../config.mk

View file

@ -1,3 +0,0 @@
#include <iostream>
int main() { std::cout << "Template" << std::endl; }

6
tent1/Makefile Normal file
View file

@ -0,0 +1,6 @@
TARGET = main.elf
SRCS = main.cc
all: $(TARGET)
include ../config.mk

5
tent1/main.cc Normal file
View file

@ -0,0 +1,5 @@
#include <iostream>
int main() {
std::cout << "Hola" << std::endl;
}

6
tent2/Makefile Normal file
View file

@ -0,0 +1,6 @@
TARGET = main.elf
SRCS = main.cc
all: $(TARGET)
include ../config.mk

5
tent2/main.cc Normal file
View file

@ -0,0 +1,5 @@
#include <iostream>
int main() {
std::cout << "Hola" << std::endl;
}