Re: [dev] Simplify Reference Casts by template constructors

2009-03-12 Thread Mathias Bauer
Rainman Lee wrote: Hi Andrew I know that implicit conversions usually bring more side effects than convenience. But it is not the reason that we should give all them up I think ;) There is no implicit conversion from std::string to const char*, because if a string is destroyed, the pointer

Re: [dev] Simplify Reference Casts by template constructors

2009-03-12 Thread Andrew Douglas Pitonyak
Rainman Lee wrote: Hi Andrew I know that implicit conversions usually bring more side effects than convenience. But it is not the reason that we should give all them up I think ;) There is no implicit conversion from std::string to const char*, because if a string is destroyed, the pointer to

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Frank Schönheit - Sun Microsystems Germany
Hi Rainman, After a period of time of developing with URE, I find the C++ UNO class Reference is not very comfortable for use sometime. The problem is, when I have a reference of base interface XA and a reference of derived interface XB, I can't make xA = xB directly. Instead I have to query

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Rainman Lee
Thank you Frank, you are right, get() is enough. I haven't seen it before;) On Wed, Mar 11, 2009 at 4:05 PM, Frank Schönheit - Sun Microsystems Germany frank.schoenh...@sun.com wrote: Hi Rainman, After a period of time of developing with URE, I find the C++ UNO class Reference is not very

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Rainman Lee
Hey Frank, I have another ideal, it is better and safer than the last one I mentioned. I add a conversion operator to Reference, instead of a constructor, here is it: template class base_interface_type inline SAL_CALL operator const Reference base_interface_type () const

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Frank Schönheit - Sun Microsystems Germany
Hi Rainman, I have another ideal, it is better and safer than the last one I mentioned. I add a conversion operator to Reference, instead of a constructor, here is it: template class base_interface_type inline SAL_CALL operator const Reference base_interface_type () const

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Rainman Lee
Hi Frank, No, I did not compile the OOo yet. I have only recompile our product which was developed completely upon URE. It seems that is compatible with existing code well. On Wed, Mar 11, 2009 at 7:19 PM, Frank Schönheit - Sun Microsystems Germany frank.schoenh...@sun.com wrote: Hi Rainman, I

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Stephan Bergmann
On 03/11/09 12:19, Frank Schönheit - Sun Microsystems Germany wrote: Admittedly, this feeling is not backed up by strong arguments, but I am sure others could come up with some. Stephan? Just keep it simple. ;) -Stephan -

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Andrew Douglas Pitonyak
Frank Schönheit - Sun Microsystems Germany wrote: Hi Rainman, I have another ideal, it is better and safer than the last one I mentioned. I add a conversion operator to Reference, instead of a constructor, here is it: template class base_interface_type inline SAL_CALL

Re: [dev] Simplify Reference Casts by template constructors

2009-03-11 Thread Rainman Lee
Hi Andrew I know that implicit conversions usually bring more side effects than convenience. But it is not the reason that we should give all them up I think ;) There is no implicit conversion from std::string to const char*, because if a string is destroyed, the pointer to its content will be

[dev] Simplify Reference Casts by template constructors

2009-03-10 Thread Rainman Lee
Hi everyone, After a period of time of developing with URE, I find the C++ UNO class Reference is not very comfortable for use sometime. The problem is, when I have a reference of base interface XA and a reference of derived interface XB, I can't make xA = xB directly. Instead I have to query XA