// (C) Copyright 2008-2009 SDML (www.sdml.info) // // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Fun with traps. // Generic algorithm template void foo(T const&) { }; namespace Foo_ { template overload_failure foo(T const&); template struct has_foo { typedef decltype(foo(typename cons::type())) DeclType; typedef mpl::bool_::value> type; }; } // namespace Foo_ template struct has_foo : Foo_::has_foo::type { };