1
General discussions / Re: Is sf::GlResource not missing an explicit copy constructor?
« on: August 04, 2014, 09:21:08 am »
Yes, I misunderstood that.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
What's the point of arguing? Since it can be called, it must be defined, so that it does what it's supposed to do.
Okay, something is wrong:
http://oi60.tinypic.com/2hyyo01.jpg
http://oi58.tinypic.com/28tevj7.jpg
http://oi58.tinypic.com/2s1a9si.jpg
Mind showing us your test then?
I showed you mine, and the result speaks for itself.
What you are forgetting is that any (even the implicitly) declared base class copy constructor has to be explicitly called by the derived class copy constructor, else the base class constructor will be called instead. GlResource does have an implicitly declared and defined copy constructor, but since none of the derived classes explicitly call it, its normal constructor is called instead, thus incrementing the reference count as expected every time a GlResource is copy constructed.
Here is a demonstration of this.
I think he wants to create dll that when included provides SFML without need to include/link it explicitly.QuoteWhy is it pointless?floats are usually 4 bytes, pointers(so references too) are 4 or 8(so more or equal) + there is cost of dereferencing and so on..
Make sure the SFML headers are in the path of include directories. Everything is explained in the official tutorial, please read it carefully.
And returning a const-reference to float is pointless. Just return a copy.