boost_no_cxx11_allocator.ipp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // (C) Copyright John Maddock 2012
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_ALLOCATOR
  7. // TITLE: C++11 <memory> doesn't have C++0x allocator support
  8. // DESCRIPTION: The compiler does not support the C++11 allocator features added to <memory>
  9. #include <memory>
  10. namespace boost_no_cxx11_allocator {
  11. int test()
  12. {
  13. std::pointer_traits<char*>* p = 0;
  14. (void) p;
  15. //std::pointer_safety s = std::relaxed;
  16. //char* (*l_undeclare_reachable)(char *p) = std::undeclare_reachable;
  17. //void (*l_declare_no_pointers)(char *p, size_t n) = std::declare_no_pointers;
  18. //void (*l_undeclare_no_pointers)(char *p, size_t n) = std::undeclare_no_pointers;
  19. //std::pointer_safety (*l_get_pointer_safety)() = std::get_pointer_safety;
  20. //void* (*l_align)(std::size_t alignment, std::size_t size, void *&ptr, std::size_t& space) = std::align;
  21. std::allocator_arg_t aat;
  22. std::uses_allocator<int, std::allocator<int> > ua;
  23. std::allocator_traits<std::allocator<int> > at;
  24. std::allocator<int> ia;
  25. std::allocator_traits<std::allocator<int> >::rebind_alloc<void*> ra(ia);
  26. std::allocator<void*>* pva = &ra;
  27. std::allocator_traits<std::allocator<int> >::rebind_traits<void*>::pointer pt;
  28. (void)aat;
  29. (void)ua;
  30. (void)at;
  31. (void)pva;
  32. (void)pt;
  33. return 0;
  34. }
  35. }