dimanche 16 juillet 2023

std::__1::ostream cannot be defined in the current scope

I have no idea why it is telling me it is out of scope.

namespace sdds
{
    class Shape
    {
    public:

        virtual ~Shape() {} // Empty virtual destructor

        virtual void draw(std::ostream &os)const = 0; //Returns void and receives a reference to ostream as an argument
        virtual void getSpecs(std::istream &is) = 0; //Returns void and receives a reference to istream as an argument.
    }

    //Helper Functions:
    std::ostream& operator<<(std::ostream &os, const Shape& shape); //Overload the insertion so any shape object can be written
    std::istream& operator>>(std::istream &is, Shape& shape); //Overload the extraction operators so any shape object can be read 

my error:

type "std::__1::ostream" cannot be defined in the current scopeC/C++(551)

I have not made my .cpp file for this class yet.

Aucun commentaire:

Enregistrer un commentaire