The code below is suppose to compile and execute. However, when compiling, an error C2280 is generated by line 94 as it is attempting to reference a deleted function.
As you surmise, the problem is on line 94. The ranged for loop there is trying to create a copy of each element in the vector of unique pointers. In effect, trying to create a copy of a unique pointer. This is forbidden.
However, you don't need a copy, do you? You can just use the actual unique pointer in the vector. You can tell the range based for loop that you want to work with a reference to the unique pointer, rather than a copy of it:
#define interface struct tells the preprocessor to find every instance of the word interface and replace it with the word struct, before the compiler gets to look at the code. So the compiler sees this:
What you've got here is someone writing their own programming language using the preprocessor. I'm guessing that someone wanted to mark out their abstract classes with the word "interface" in the code. I have to say that if I saw this in a code review in code that a team had to work on (obviously individuals can do whatever they like with their code!), I'd send it back because
1) The word "interface" could well come up in other code, maybe in the future, and one day someone else's code will break because they used the word "interface" for something else entirely (such as part of a variable name, or a function call, or anything really). This is a little landmine that will blow up in someone else's face in the future, which is very bad manners.
2) The convention of using "I" on the class name is already a widely recognised way to suggest that you intend this class to be abstract, and contain only some functions; no need to create your own programming language using the preprocessor.
#define interface struct tells the preprocessor to find every instance of the word interface and replace it with the word struct, before the compiler gets to look at the code. So the compiler sees this:...
Basically, an interface is a class that has no functionality and only applies to virtual functions. The purpose of an interface is to define behavior. A concrete class that derives from an interface must provide an implementation of all of the methods of the interface, and hence, this makes the interface a kind of a contract. ... Interface programming decouples behavior from implementation. Client code is only interested in the actual class that provides the interface.