test_stubs.h 418 B

123456789101112131415161718192021222324
  1. //
  2. // test_stubs.h
  3. // pointers
  4. //
  5. // Created by Sam Jaffe on 8/12/20.
  6. // Copyright © 2020 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. struct const_tracking_stub {
  10. bool is_const() { return false; }
  11. bool is_const() const { return true; }
  12. };
  13. struct destructor_sentinal {
  14. ~destructor_sentinal() { ref_ = true; }
  15. bool & ref_;
  16. };
  17. struct destructor_ctr {
  18. ~destructor_ctr() { ++ref_; }
  19. int & ref_;
  20. };