Fernando Cacciola wrote:
[...]
>> BTW implicit cast to reference types are not implicit under GCC,
>> they have to be called explicitly.
>
> Yes, this is the conformant behaviour AFAIK
But it will work if the cast operator is not a member template. Maybe
"template cast to reference type" should
"Fernando Cacciola" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [...]
> You would like to be dealing with:
>
> optional* and optional*
Yes, exactly.
> but you can do this as well, so I figure that what you really
> need is a 'dynamic-type preserving' conversion between these
> o
"Philippe A. Bouchard" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
>
> "Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> [...]
>
> > int main()
> > {
> > optional b;
> > optional c;
> >
> > foo(b);
> > //foo(c);
> > }
>
>
"Philippe A. Bouchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[...]
> int main()
> {
> optional b;
> optional c;
>
> foo(b);
> //foo(c);
> }
BTW implicit cast to reference types are not implicit under GCC, they have
to be called explicitly. Template casts d
Philippe A. Bouchard wrote:
[...]
> void foo(optional const &)
> {
> }
>
> int main()
> {
> optional b;
> optional c;
>
> foo(b);
> //foo(c);
> }
There is a bool (m_initialized) that will prevent the pointer to access
directly the virtual table. It may not be the case if the boo
David B. Held wrote:
[...]
> and then just store Base*, but this requires explicit run-time
> checking of types which would otherwise be automatic with pointers to
> T instead of optional. If this is the only solution, so be it;
> but any clever alternatives are welcome.
This example is not obj
"David B. Held" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> I think optional might be perfect for an issue I have, but there is one
> catch.
> I have a polymorphic hierarchy that I would like to use with optional, but
> optional is not a base of optional. Of course, this is