I'm studying C++ and I am quite a beginner, and I came up with some questions I really need to solve, to learn well and understand even better. I hope someone of you will clarify these!
So:
1) Is the best specialization of a template function the ones that is written as the last one in the namespace of the primary reference?
2) Does an enum class admit implicit conversions to the below type?
3) Could a CATCH clause that receives an object of type DOUBLE, capture a THROW expression of type LONG DOUBLE?
1.) I don't understand the question.
2.) No. This is the primary advantage of scoped enumerations.
3.) No. An exception of type long double will not be matched with a handler that wants a double.
4.) You can throw rvalues; the active exception object is copy-initialized from the expression on the right of the throw keyword.
To answer literally, the throw-expression itself is always a [p]rvalue of type void.
I'm sorry for my inability of expressing myself in the first question, I tried to translate from the Italian, I failed lol.
By the way thank you so much!!
Oh, another fast thing: what if in the question number 3) we exchange DOUBLE with LONG DOUBLE in both parts? That is: "a CATCH clause that receives an object of type LONG DOUBLE doesn't capture a THROW expression of type DOUBLE". True or false?