fail_adl_detail.cpp 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Boost.Units - A C++ library for zero-overhead dimensional analysis and
  2. // unit/quantity manipulation and conversion
  3. //
  4. // Copyright (C) 2003-2008 Matthias Christian Schabel
  5. // Copyright (C) 2008 Steven Watanabe
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See
  8. // accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. /**
  11. \file
  12. \brief fail_adl_detail.cpp
  13. \details
  14. make sure that namespace detail is not pulled in by ADL.
  15. Output:
  16. @verbatim
  17. @endverbatim
  18. **/
  19. #include <boost/units/quantity.hpp>
  20. #include <boost/units/systems/si.hpp>
  21. namespace bu = boost::units;
  22. namespace boost {
  23. namespace units {
  24. namespace detail {
  25. template<class T>
  26. void this_function_should_not_be_found_by_adl(const T&) {};
  27. }
  28. }
  29. }
  30. int main(int argc,char *argv[])
  31. {
  32. bu::quantity<bu::si::energy> q;
  33. this_function_should_not_be_found_by_adl(q);
  34. return 0;
  35. }