I have function foo1 (const pair<unsigned char*, size_t>* p);
I need also function foo2 (const pair<const unsigned char*, size_t>*
p) that does the same thing as foo1().
Currently
void foo2 (const pair<const unsigned char*, size_t>* p)
{
// I would like to use here C++-style casting
const pair<unsigned char*, size_t>* p1 = ( const pair<unsigned
char*, size_t>* ) p;
foo1(p1);
}
I'm sorry that my previous post misled you.
I think sam got my answer.
What I asked is that I was confused that why you need
such conversion. And I was expecting to see if there's some
way to avoid such conversion.
If you just wanted to learn the language. OK, "reinterpret_cast"
as C++-style cast, or just use C-style cast. While in practice,
avoid doing this.