Chris@16: // Copyright Daniel Wallin, David Abrahams 2005. Use, modification and Chris@16: // distribution is subject to the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef DEFAULT_050329_HPP Chris@16: # define DEFAULT_050329_HPP Chris@16: Chris@16: # include Chris@16: Chris@16: namespace boost { namespace parameter { namespace aux { Chris@16: Chris@16: // A wrapper for the default value passed by the user when resolving Chris@16: // the value of the parameter with the given Keyword Chris@16: template Chris@16: struct default_ Chris@16: { Chris@16: default_(Value& x) Chris@16: : value(x) Chris@16: {} Chris@16: Chris@16: Value& value; Chris@16: }; Chris@16: Chris@16: // Chris@16: // lazy_default -- Chris@16: // Chris@16: // A wrapper for the default value computation function passed by Chris@16: // the user when resolving the value of the parameter with the Chris@16: // given keyword Chris@16: // Chris@16: # if BOOST_WORKAROUND(__EDG_VERSION__, <= 300) Chris@16: // These compilers need a little extra help with overload Chris@16: // resolution; we have empty_arg_list's operator[] accept a base Chris@16: // class to make that overload less preferable. Chris@16: template Chris@16: struct lazy_default_base Chris@16: { Chris@16: lazy_default_base(DefaultComputer const& x) Chris@16: : compute_default(x) Chris@16: {} Chris@16: DefaultComputer const& compute_default; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct lazy_default Chris@16: : lazy_default_base Chris@16: { Chris@16: lazy_default(DefaultComputer const & x) Chris@16: : lazy_default_base(x) Chris@16: {} Chris@16: }; Chris@16: # define BOOST_PARAMETER_lazy_default_fallback lazy_default_base Chris@16: # else Chris@16: template Chris@16: struct lazy_default Chris@16: { Chris@16: lazy_default(const DefaultComputer& x) Chris@16: : compute_default(x) Chris@16: {} Chris@16: DefaultComputer const& compute_default; Chris@16: }; Chris@16: # define BOOST_PARAMETER_lazy_default_fallback lazy_default Chris@16: # endif Chris@16: Chris@16: }}} // namespace boost::parameter::aux Chris@16: Chris@16: #endif // DEFAULT_050329_HPP Chris@16: