1
Feature requests / Re: Add sf::String::at(), analagous to std::string::at()
« on: July 23, 2016, 08:05:57 pm »Just as a tiny suggestion. You could just use std::string instead of sf::String for string storing/manipulation.And SFML could do that too, but there's a good reason it doesnt, so I don't either
It's a questionable way of error handling, like checking every pointer against null before dereferencing it, or checking divisors against 0...That would be great!
Reasonable implementations of the STL (which is used internally by sf::String) provide you with assertions for such cases. They show you all your logic errors when debugging, but you get full speed in Release mode and don't need to clutter code with try-catch blocks, to which you can't even meaningfully react, as the bug shouldn't exist in the first place.
All I am saying is this code should break:
sf::String s("A");
std::cout << s[1] << std::endl;
std::cout << s[1] << std::endl;