1 // Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
2 // distribution is subject to the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef DEFAULT_050329_HPP
7 # define DEFAULT_050329_HPP
9 # include <boost/detail/workaround.hpp>
11 namespace boost { namespace parameter { namespace aux {
13 // A wrapper for the default value passed by the user when resolving
14 // the value of the parameter with the given Keyword
15 template <class Keyword, class Value>
28 // A wrapper for the default value computation function passed by
29 // the user when resolving the value of the parameter with the
32 # if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
33 // These compilers need a little extra help with overload
34 // resolution; we have empty_arg_list's operator[] accept a base
35 // class to make that overload less preferable.
36 template <class KW, class DefaultComputer>
37 struct lazy_default_base
39 lazy_default_base(DefaultComputer const& x)
42 DefaultComputer const& compute_default;
45 template <class KW, class DefaultComputer>
47 : lazy_default_base<KW,DefaultComputer>
49 lazy_default(DefaultComputer const & x)
50 : lazy_default_base<KW,DefaultComputer>(x)
53 # define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
55 template <class KW, class DefaultComputer>
58 lazy_default(const DefaultComputer& x)
61 DefaultComputer const& compute_default;
63 # define BOOST_PARAMETER_lazy_default_fallback lazy_default
66 }}} // namespace boost::parameter::aux
68 #endif // DEFAULT_050329_HPP