* leomayleomay@gmail.com:
> On 8 10 , 11 53 , "Alf P. Steinbach" <al...@start.no> wrote:
>> An explicit constructor must be called explictly.
>> You don't call it explicitly, so how can you expect it to be called?
>
> So, you mean if I define a explicit copy constructor, there can not be
> any temporary object in my code, right?
No, I don't mean that. A temporary object need not be copied. In
particular, you can call member functions on a temporary object.
>> Apart from that, first, you really don't want to use reinterpret_cast as
>> you do above, and secondly, the templated constructor isn't a copy
>> constructor -- a "copy constructor" is by definition not templated.
>
> The templated constructor is used for type casting from Derived<U> to
> Derived<T>.
Yes, and you really don't want to use reinterpret_cast for that,
especially not in the disguise of a C-style cast.
> Thanks for your informative tips.
> Big thanks goes to you.
You're welcome.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?