Initial Course
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "inheritance.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace oop {
|
||||
|
||||
[[nodiscard]] auto total_area(const std::vector<std::unique_ptr<Shape>>& shapes) -> double;
|
||||
[[nodiscard]] auto shape_names(const std::vector<std::unique_ptr<Shape>>& shapes)
|
||||
-> std::vector<std::string>;
|
||||
|
||||
class Counter {
|
||||
public:
|
||||
Counter() = default;
|
||||
Counter(const Counter&) { ++copies_; }
|
||||
auto operator=(const Counter&) -> Counter& {
|
||||
++copies_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] static auto copies() -> int;
|
||||
|
||||
private:
|
||||
inline static int copies_ = 0;
|
||||
};
|
||||
|
||||
} // namespace oop
|
||||
Reference in New Issue
Block a user