Gabriel Dos Reis writes:
>
> Hi,
>
> Anthony Williams <[EMAIL PROTECTED]> writes:
>
> [...]
>
> | > You made youself clear.
> | >
> | > However, there are two running issues originating from a claim of Dave
> | > that dangerous_cast<> might be better than reinterpret_cast<> in
Hi,
Anthony Williams <[EMAIL PROTECTED]> writes:
[...]
| > You made youself clear.
| >
| > However, there are two running issues originating from a claim of Dave
| > that dangerous_cast<> might be better than reinterpret_cast<> in
| > casting from U* to T* (dangerous_cast<> uses the inter
Gabriel Dos Reis writes:
> Anthony Williams <[EMAIL PROTECTED]> writes:
>
> | > Anthony Williams <[EMAIL PROTECTED]> writes:
> | >
> | > [...]
> | >
> | > | 3.10p15:
> | > | "If a program attempts to access the stored value of an object through an
> | > | lvalue of other than
Anthony Williams <[EMAIL PROTECTED]> writes:
| > Anthony Williams <[EMAIL PROTECTED]> writes:
| >
| > [...]
| >
| > | 3.10p15:
| > | "If a program attempts to access the stored value of an object through an
| > | lvalue of other than one of the following types the behavior is undefine
Gabriel Dos Reis writes:
> Hi,
Hi
> Anthony Williams <[EMAIL PROTECTED]> writes:
>
> [...]
>
> | 3.10p15:
> | "If a program attempts to access the stored value of an object through an
> | lvalue of other than one of the following types the behavior is undefined:
> |
> | - the d
Hi,
Anthony Williams <[EMAIL PROTECTED]> writes:
[...]
| 3.10p15:
| "If a program attempts to access the stored value of an object through an
| lvalue of other than one of the following types the behavior is undefined:
|
| - the dynamic type of the object,
|
| ...
|
| - a char or u
Gabriel Dos Reis writes:
> "Peter Dimov" <[EMAIL PROTECTED]> writes:
>
> | From: "Gabriel Dos Reis" <[EMAIL PROTECTED]>
> | > David Abrahams <[EMAIL PROTECTED]> writes:
> | >
> | > | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> | > |
> | > | > Hmm, I have a couple of questions answers to
"Peter Dimov" <[EMAIL PROTECTED]> writes:
| From: "Gabriel Dos Reis" <[EMAIL PROTECTED]>
| > David Abrahams <[EMAIL PROTECTED]> writes:
| >
| > | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
| > |
| > | > Hmm, I have a couple of questions answers to which will help me
| > | > get your point.
| > |
From: "Gabriel Dos Reis" <[EMAIL PROTECTED]>
> David Abrahams <[EMAIL PROTECTED]> writes:
>
> | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> |
> | > Hmm, I have a couple of questions answers to which will help me
> | > get your point.
> | >
> | > 1) Why can't you do that with reinterpret_cast?
>
Terje Slettebø <[EMAIL PROTECTED]> writes:
| >From: "Gabriel Dos Reis" <[EMAIL PROTECTED]>
|
| > Terje Slettebø <[EMAIL PROTECTED]> writes:
| >
| > | >From: "Terje Slettebø" <[EMAIL PROTECTED]>
| > |
| > | > >From: "David Abrahams" <[EMAIL PROTECTED]>
| > | >
| > | > > Gabriel Dos Reis <[EMAIL PR
David Abrahams <[EMAIL PROTECTED]> writes:
| Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
|
| > Hmm, I have a couple of questions answers to which will help me
| > get your point.
| >
| > 1) Why can't you do that with reinterpret_cast?
|
| You can, but the results are non-portable
No more non-
>From: "Gabriel Dos Reis" <[EMAIL PROTECTED]>
> Terje Slettebø <[EMAIL PROTECTED]> writes:
>
> | >From: "Terje Slettebø" <[EMAIL PROTECTED]>
> |
> | > >From: "David Abrahams" <[EMAIL PROTECTED]>
> | >
> | > > Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> | > >
> | > > > Is it any different from r
Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> Hmm, I have a couple of questions answers to which will help me
> get your point.
>
> 1) Why can't you do that with reinterpret_cast?
You can, but the results are non-portable
> 2) Why is that supposed to be better than reinterpret_cast<>?
The re
Terje Slettebø <[EMAIL PROTECTED]> writes:
| >From: "Terje Slettebø" <[EMAIL PROTECTED]>
|
| > >From: "David Abrahams" <[EMAIL PROTECTED]>
| >
| > > Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
| > >
| > > > Is it any different from reinterpret_cast(p) ?
| > >
| > > It might be, depending on your
David Abrahams <[EMAIL PROTECTED]> writes:
| Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
|
| > David Abrahams <[EMAIL PROTECTED]> writes:
| >
| > | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
| > |
| > | > "David B. Held" <[EMAIL PROTECTED]> writes:
| > | >
| > | > | Does this have any merit w
Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> David Abrahams <[EMAIL PROTECTED]> writes:
>
> | Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> |
> | > "David B. Held" <[EMAIL PROTECTED]> writes:
> | >
> | > | Does this have any merit whatsoever?
> | > |
> | > | template
> | > | T* dangerous_cas
>From: "Terje Slettebø" <[EMAIL PROTECTED]>
> >From: "David Abrahams" <[EMAIL PROTECTED]>
>
> > Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> >
> > > Is it any different from reinterpret_cast(p) ?
> >
> > It might be, depending on your compiler. The behavior of
> > reinterpret_cast is implementat
>From: "David Abrahams" <[EMAIL PROTECTED]>
> Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
>
> > "David B. Held" <[EMAIL PROTECTED]> writes:
> >
> > | Does this have any merit whatsoever?
> > |
> > | template
> > | T* dangerous_cast(U* p)
> > | {
> > | return static_cast(static_cast(p));
> >
David Abrahams <[EMAIL PROTECTED]> writes:
| Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
|
| > "David B. Held" <[EMAIL PROTECTED]> writes:
| >
| > | Does this have any merit whatsoever?
| > |
| > | template
| > | T* dangerous_cast(U* p)
| > | {
| > | return static_cast(static_cast(p));
| >
Gabriel Dos Reis <[EMAIL PROTECTED]> writes:
> "David B. Held" <[EMAIL PROTECTED]> writes:
>
> | Does this have any merit whatsoever?
> |
> | template
> | T* dangerous_cast(U* p)
> | {
> | return static_cast(static_cast(p));
> | }
>
> Is it any different from reinterpret_cast(p) ?
It might
"David B. Held" <[EMAIL PROTECTED]> writes:
| Does this have any merit whatsoever?
|
| template
| T* dangerous_cast(U* p)
| {
| return static_cast(static_cast(p));
| }
Is it any different from reinterpret_cast(p) ?
-- Gaby
___
Unsubscribe & other
"David B. Held" <[EMAIL PROTECTED]> writes:
> Does this have any merit whatsoever?
>
> template
> T* dangerous_cast(U* p)
> {
> return static_cast(static_cast(p));
> }
>
> Obviously, you only use it when you know the binary layout of some
> object(s) and no other cast produces defined or reli
Does this have any merit whatsoever?
template
T* dangerous_cast(U* p)
{
return static_cast(static_cast(p));
}
Obviously, you only use it when you know the binary layout of some
object(s) and no other cast produces defined or reliable behaviour.
Of course, I'm not sure this produces either of
23 matches
Mail list logo