SFML community forums

General => General discussions => Topic started by: Michalus on August 01, 2013, 07:07:10 pm

Title: SFML Book chapter 2 question
Post by: Michalus on August 01, 2013, 07:07:10 pm
I read at this moment the sfml development book.
I am at chapter 2 before the headline Error handling.
There stand at the TextureHolder class, two get methods
first:
sf::Texture& get (Textures::ID id);
 
second:
const sf::Texture& get (Textures::ID id) const;
 

But I dont understand the sense of the second method.
The methods do  actually almost the same.
Title: Re: SFML Book chapter 2 question
Post by: eXpl0it3r on August 01, 2013, 07:10:11 pm
Yes they do almost the same. So what's the difference? What do those const mean? ;)
Title: Re: SFML Book chapter 2 question
Post by: FRex on August 01, 2013, 07:11:49 pm
http://www.parashift.com/c++-faq/const-overloading.html