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 /** 12 \file 13 14 \brief fail_adl_detail.cpp 15 16 \details 17 make sure that namespace detail is not pulled in by ADL. 18 19 Output: 20 @verbatim 21 @endverbatim 22 **/ 23 24 #include <boost/units/quantity.hpp> 25 #include <boost/units/systems/si.hpp> 26 27 namespace bu = boost::units; 28 29 namespace boost { 30 namespace units { 31 namespace detail { 32 33 template<class T> this_function_should_not_be_found_by_adl(const T &)34 void this_function_should_not_be_found_by_adl(const T&) {}; 35 36 } 37 } 38 } 39 main(int argc,char * argv[])40int main(int argc,char *argv[]) 41 { 42 43 bu::quantity<bu::si::energy> q; 44 45 this_function_should_not_be_found_by_adl(q); 46 47 return 0; 48 } 49