George
Tue Dec 11 03:55:01 PST 2007
Hi Bo,
I have finally find it. From the book, I only see how to use explicit
keyword -- its function. But I have not seen any practical scenarios why we
should use explicit keyword. Any experience sharing from you are welcome. :-)
regards,
George
"Bo Persson" wrote:
> George wrote:
> :: Sorry Bo,
> ::
> ::
> :: What book do you mean?
>
> The book that you are supposed to be reading. :-)
>
> The C++ Programming Language has a section 11.7.1 Explicit
> Constructors, which explains some use of the keyword. Have you read
> that yet?
>
>
> Bo Persson
>
>
> ::
> ::
> :: regards,
> :: George
> ::
> :: "Bo Persson" wrote:
> ::
> ::: George wrote:
> ::::: Thanks Alex,
> :::::
> :::::
> ::::: What benefits we could get if we use explicit keyword to prevent
> ::::: from implicit conversion? Could you show some practical usage
> ::::: scenarios please?
> :::
> ::: It is used when you just don't want an implicit conversion. :-)
> :::
> ::: What's wrong with the examples in the book?
> :::
> :::
> ::: Bo Persson
> :::
> :::::
> ::::: "Alex Blekhman" wrote:
> :::::
> :::::: "George" wrote:
> ::::::: I am reading the C++ Programming Language book, but can
> ::::::: not find the
> ::::::: function of explicit keyword of constructor. Could anyone
> ::::::: explain its usage
> ::::::: or refer some learning materials please?
> ::::::
> :::::: "explicit (C++)"
> ::::::
http://msdn2.microsoft.com/en-us/library/h1y7x448(VS.90).aspx
> ::::::
> ::::::
> :::::: HTH
> :::::: Alex
>
>
>
>