Mass reformat

This commit is contained in:
Imbus 2025-01-11 17:54:29 +01:00
parent c55321e6f1
commit eb41bede5e
7 changed files with 107 additions and 111 deletions

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 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;

View file

@ -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();
}

View file

@ -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,

View file

@ -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) {}
}; };

View file

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