[Boost-bugs] [Boost C++ Libraries] #8603: BOOST_PARAMETER_CONSTRUCTOR with no required arugments

Subject: [Boost-bugs] [Boost C++ Libraries] #8603: BOOST_PARAMETER_CONSTRUCTOR with no required arugments
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-21 18:07:44


#8603: BOOST_PARAMETER_CONSTRUCTOR with no required arugments
-----------------------------------------+----------------------------------
 Reporter: james.hirschorn@… | Owner: danielw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: parameter
  Version: Boost 1.53.0 | Severity: Showstopper
 Keywords: BOOST_PARAMETER_CONSTRUCTOR |
-----------------------------------------+----------------------------------
 The following variation on the example from the boost::parameter tutorial,
 where the required parameter is changed to optional, fails to compile.
 myclass_impl is passed an empty agrument list.


 {{{
 #include <iostream>

 #include <boost/parameter.hpp>


 BOOST_PARAMETER_NAME(name)
 BOOST_PARAMETER_NAME(index)

 struct myclass_impl
 {
     template <class ArgumentPack>
     myclass_impl(ArgumentPack const& args)
     {
         std::cout << "name = " << args[_name]
                   << "; index = " << args[_index]
                   << std::endl;
     }
 };

 struct myclass : myclass_impl
 {
     BOOST_PARAMETER_CONSTRUCTOR(
         myclass, (myclass_impl), tag
             , (optional (name, *) (index, *)
                 )
     ) // no semicolon
 };

 int main(int argc, char * argv[])
 {
     myclass C(_name="hello", _index=0);
 }

 }}}

 Compilation output:
 {{{
 In instantiation of 'myclass_impl::myclass_impl(const ArgumentPack&) [with
 ArgumentPack = boost::parameter::aux::empty_arg_list]':
 ...
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8603>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC