#include <iostream>
#include <iterator>
#include <vector>
class my_iterator : public std::iterator<std::bidirectional_iterator_tag, int> {
int d_val = 12;
public:
my_iterator operator--(int) { std::cout << "decrement--\n"; return my_iterator(); }
my_iterator &operator--() { std::cout << "--decrement\n"; return *this; }
my_iterator operator++(int) { std::cout << "increment++\n"; return my_iterator(); }
my_iterator &operator++() { std::cout << "++increment\n"; return *this; }
int &operator*() { std::cout << "*dereference\n"; return d_val; }
bool operator==(my_iterator const &o) { return false; }
bool operator!=(my_iterator const &o) { return true ; }
};
int main() {
auto it = std::reverse_iterator<my_iterator>();
int &i = *it;
if (true)
{
std::cout << i << '\n';
}
else
{
std::vector<int> vec;
vec.push_back(i);
std::cout << vec[0] << '\n';
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDx2ZWN0b3I+CgpjbGFzcyBteV9pdGVyYXRvciA6IHB1YmxpYyBzdGQ6Oml0ZXJhdG9yPHN0ZDo6YmlkaXJlY3Rpb25hbF9pdGVyYXRvcl90YWcsIGludD4gewogIGludCBkX3ZhbCA9IDEyOwpwdWJsaWM6CiAgbXlfaXRlcmF0b3IgIG9wZXJhdG9yLS0oaW50KSB7IHN0ZDo6Y291dCA8PCAiZGVjcmVtZW50LS1cbiI7IHJldHVybiBteV9pdGVyYXRvcigpOyB9CiAgbXlfaXRlcmF0b3IgJm9wZXJhdG9yLS0oKSAgICB7IHN0ZDo6Y291dCA8PCAiLS1kZWNyZW1lbnRcbiI7IHJldHVybiAqdGhpczsgfQogIG15X2l0ZXJhdG9yICBvcGVyYXRvcisrKGludCkgeyBzdGQ6OmNvdXQgPDwgImluY3JlbWVudCsrXG4iOyByZXR1cm4gbXlfaXRlcmF0b3IoKTsgfQogIG15X2l0ZXJhdG9yICZvcGVyYXRvcisrKCkgICAgeyBzdGQ6OmNvdXQgPDwgIisraW5jcmVtZW50XG4iOyByZXR1cm4gKnRoaXM7IH0KICAKICBpbnQgJm9wZ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