View difference between Paste ID: nT4Jsn6x and fg2afbzf
SHOW: | | - or go back to the newest paste.
1
struct Foo
2
{
3
    unsigned short x;
4
}
5
6
// elsewhere
7
inline Foo * Bar::operator [](int i) 
8
{
9
    // this->data is (unsigned short *)
10-
    return reinterpret_cast<Foo *>(data[i]);
10+
    return reinterpret_cast<Foo *>(&data[i]);
11
}