fork download
  1. #include <boost/interprocess/offset_ptr.hpp>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. void bar(int *) {
  6.  
  7. }
  8.  
  9. int* vv = {};
  10. void foo(boost::interprocess::offset_ptr<int> i) {
  11. cout << *i << endl;
  12. if (i == vv) cout << "OK\n";
  13. bar(i.get());
  14. }
  15.  
  16. int main() {
  17. int x = 123;
  18. auto p = &x;
  19. foo(p);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5584KB
stdin
Standard input is empty
stdout
123