brintos

brintos / llvm-project-archived public Read only

0
0
Text · 553 B · e5c5d4c Raw
31 lines · c
1#pragma once2 3/**4 * @brief Abstract base class for shapes.5 *6 * Provides a common interface for different types of shapes.7 */8class Shape {9public:10    /**11     * @brief Virtual destructor.12     */13    virtual ~Shape() {}14 15    /**16     * @brief Calculates the area of the shape.17     *18     * @return double The area of the shape.19     */20    virtual double area() const = 0;21 22    /**23     * @brief Calculates the perimeter of the shape.24     *25     * @return double The perimeter of the shape.26     */27    virtual double perimeter() const = 0;28};29 30 31