Hi Joerg,

> But that same error *is* hidden, if a non-NULL reference to another type 
> is passed (as long a the correct interface can be queried successfully).
> 
> So why detect a distinction for NULL reference that is not detected for 
> others?

My first idea (see below before flaming me) would be: because that's not
an error then: If the value is required to be of type T, and the caller
passed an object which can be queried for T, this is no error.

However, I admit that this would lead to:

void doSomething()
{
  Reference< XInterface > xValue = getValueFromSomewhere();
    // allowed to be NULL
  if ( xValue.is() )
    setFacetValue( ID_FACET_OF_TYPE_T, Any( xValue ) );
  else
    setFacetValue( ID_FACET_OF_TYPE_T, Any( Reference< T >() ) );
}

Hmm. Pretty weird.

Okay, I didn't say anything against 4. ... :)

Ciao
Frank

-- 
- Frank Sch�nheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems, Inc.                           http://www.sun.com -
- OpenOffice.org Database Access            http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to