Hi,
Everything is in the title, I want to create a vector with some classes with NonCopyable members (sf::Shader, but the error is the same with other classes), and my compiler says that I use a deleted function, and I'm almost sure that is because my class member is a NonCopyable:
#include <SFML/Graphics.hpp>
class Object {
public:
Object(){};
protected:
sf::Shader m_shader;
};
int main(){
std::vector<Object> tmp( 27, Object());
}
Error:
G:\...\MinGW-5.1.0\...\stl_construct.h|75|error: use of deleted function 'Object::Object(const Object&)'|
G:\...\main.cpp|3|note: 'Object::Object(const Object&)' is implicitly deleted because the default definition would be ill-formed:|
G:\...\SFML-2.5.0\...\NonCopyable.hpp|77|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
I don't really want to use pointers or std::shared_ptr to use SFML things, so here is my question: Am I doing something wrong, or is it just the way SFML works?