Marián
Marián
example of player::player
Marián
Marián
this happens without pragma -> says i redefine the class, the only thing i do is inheritance tho
Marián
That's not standard
my bad, i didn't put my header into #define #enddif
Marián
but i still have this issue
Anonymous
Marián
yup
Marián
Marián
but why do i get this bunch of errors
Marián
Anonymous
You've declared but not defined functions
Marián
Marián
hmm
Francisco
For the record, try to post a minimal example that reproduces your problem, so we can compile it and figure out what's going on
Marián
ok wait
Marián
is pastebin enough or is it better for you if I send entire project
Marián
it's small like 4 source files
Mat
Try to reproduce your error with a minimal project
Marián
uh ok
Marián
btw do i have to implement virtuals in c++?
Marián
i was looking for something like abstract in C# but found only virtual modifier
Marián
do i have to implement it in base class?
Anonymous
To make a class abstract you need to declare at least one member function as pure virtual: virtual foo() = 0;
Anonymous
And you need to declare a destructor to be virtual virtual ~MyClass() = default;
Anonymous
C#?
C++
Anonymous
Even though without this may lead to some random behaviour at times when you delete the derived object using Base's pointer.
Anonymous
Is this necessary for making a class abstract?
It's necessary for making class polymorphic and behave correctly
Anonymous
BTW, polymorphic classes are those which have a virtual function or inherit one. Right?
Anonymous
so both base and derived come are polymorphic?
Francisco
is pastebin enough or is it better for you if I send entire project
Never send an entire project. Just a code snippet that reproduces your problem. Also, by doing that every time you a face a bug, you normally end up finding it before asking for help
Marián
thanks, already fixed it, i just forgot to link lib to qmake...
Francisco
In fact, I've found a couple compiler bugs by doing that
Anonymous
Hello
Anonymous
I need c software for mac
Anonymous
Please help where I download it?
Mat
An editor? An ide? A compiler?
Anonymous
What?
I need c programming software for mac
Anonymous
hello i want to start learning C++ can anyone please help
Anonymous
Answer me!
For practice where I practice
Anonymous
how to look inside the classes of the c++ standard'
Anonymous
You don't need that
I wanted to check what all member functions are present in the ostream class
Anonymous
Why...
Anonymous
Why...
I read that The out is of type std::ostream. This can not be copied (the copy constructor is disabled). So you need to pass by reference.
Anonymous
So, wanted to see how the copy constructor looks inside the ostream class
Anonymous
what does disabled mean?
Anonymous
There's no copy constructor
so the default one runs right?
Artöm
It is deleted or privated
Artöm
so the default one runs right?
No, it is explicitly deleted
Anonymous
For example: ostream(const ostream&) = delete;
Anonymous
Anonymous
For example: ostream(const ostream&) = delete;
It's C++11 feature In early C++ it looks like: private: ostream(const ostream&);
Anonymous
It's C++11 feature In early C++ it looks like: private: ostream(const ostream&);
So, that's why ostream& operator<<(ostream& out, Objects const& obj) ostream is returned by reference and called by reference so that the privated copy constructor doesn't get called?
Anonymous
Some classes can't be copied by its semantics Like streams, unique_ptrs, etc
Anonymous
it's not the same
It serves the same purpose
Anonymous
Yes And to allow to chain operator<< calls
Had the copy constructor not been privated wouldn't returning the called object out have served the chaining purpose?
Serhii
I don't get the question
You wouldn't get it
Stanislav
It serves the same purpose
what happened if class call private ("deleted") itself or friend class/function?
Serhii
?
Nvm, joker reference)