boost_no_adl_barrier.ipp 756 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright John Maddock 2008.
  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 most recent version.
  6. // MACRO: BOOST_NO_ADL_BARRIER
  7. // TITLE: Working ADL barriers.
  8. // DESCRIPTION: If the compiler correctly handles ADL.
  9. namespace boost_no_adl_barrier{
  10. namespace xxx {
  11. namespace nested {
  12. struct aaa {};
  13. }
  14. void begin(nested::aaa) {}
  15. }
  16. namespace nnn {
  17. void begin(xxx::nested::aaa) {}
  18. }
  19. int test()
  20. {
  21. using namespace nnn;
  22. xxx::nested::aaa a;
  23. begin(a); // ambiguous error in msvc-9.0
  24. return 0;
  25. }
  26. }