test_lib.cpp 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright (c) 2012-2019 Antony Polukhin.
  3. //
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. #define TEST_LIB_SOURCE
  9. #include "test_lib.hpp"
  10. namespace user_defined_namespace {
  11. class user_defined{};
  12. }
  13. namespace test_lib {
  14. boost::typeindex::type_index get_integer() {
  15. return boost::typeindex::type_id<int>();
  16. }
  17. boost::typeindex::type_index get_user_defined_class() {
  18. return boost::typeindex::type_id<user_defined_namespace::user_defined>();
  19. }
  20. boost::typeindex::type_index get_const_integer() {
  21. return boost::typeindex::type_id_with_cvr<const int>();
  22. }
  23. boost::typeindex::type_index get_const_user_defined_class() {
  24. return boost::typeindex::type_id_with_cvr<const user_defined_namespace::user_defined>();
  25. }
  26. #if !defined(BOOST_HAS_PRAGMA_DETECT_MISMATCH) || !defined(_CPPRTTI)
  27. // Just do nothing
  28. void accept_typeindex(const boost::typeindex::type_index&) {}
  29. #endif
  30. }