I am trying to implement this logic in C ++:
Object obj(args);
while (obj.isOK()) {
obj = obj.next();
}
But I cannot use this exact code because it Objectinherits boost::noncopyable, therefore it does not have an assignment operator. I can add methods and constructors to Object(but not make it copyable), however I would prefer not to. Other issues include manually destroying and placing the new one as a solution, which I could make if I create a new constructor for Object, but again, preferably, I don’t need a new constructor, and it still seems like a rather unpleasant solution. What are my alternatives?
source
share