31 lines
627 B
C++
31 lines
627 B
C++
#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
|