Recently I have seen a design of a colleague. In such design he came up with a class that looks something like this:
class A {
A() = delete;
A (const std::string &strA, const std::string &strB) noexcept;
}
The thing that itches me is: Does it really make sense here to explicitly delete the 'A()' constructor?
To try to figure out if there where any implications, in the case that such constructor were not explicitly deleted (but it were simply absent), I opened Eclipse and made a test, and it turned out that (in my case) you can completely dismiss the first constructor (keeping the second one), and the compiler will complain if anybody tries to instantiate an object of 'A' without giving the required list of parameters (i.e. "A myA;" or "A myA = A();" ).
Therefore: For which reason(s) is it desirable to explicitly delete the 'A()' constructor, when you will have a constructor (or several constructors) that takes parameters?
EDIT
I have already seen this post. But IMHO my question extends the question asked in that post. I am/was curios to understand why could it be necessary to explicitly delete a constructor when there are other constructor(s) which take(s) parameters. It didn't make sense to me, but I wanted to check if there were any technical reasons for doing so. What is explained in this post was already cleared to me. That post explains the effects of explicitly deleting a constructor and does not give any further examples of valid use cases or reasons that state when and why it is desirable to do so (one answer explains the effects of deleting the constructor and the other answer explicitly states, that it is an assumption of @gybacsi on a very specific piece of source code).