Boost logo

Boost Users :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2005-02-23 07:31:28


Orhun Birsoy wrote:

>Hi,
>I am getting boost::io::too_many_args exceptions for the following line.
>
>cout << format(" %1% %3% \n") % 1 % 2 % 3 % 4 % 5;
>
>but not for this one
>
>cout << format(" %1% %5% \n") % 1 % 2 % 3 % 4 % 5;
>
>If the last argument is used in the format, I do not get the exception.
>
>Is this a bug?
>
>Thanks.
>
>Orhun Birsoy
>
>
>

this is by design, and mentionned in the documentation :
"""
The only constraint is that it expects exactly /P/ arguments, /P/ being
the maximum argument number used in the format string. (e.g., for "%1$d
%10$d", /P/ is 10 ).
Supplying more, or less, than /P/ arguments raises an exception. (unless
it was set otherwise, see exceptions
<http://www.boost.org/libs/format/doc/format.html#exceptions>)
"""
regards,

-- 
Samuel

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net