Opened 12 years ago

Closed 12 years ago

#5375 closed Bugs (worksforme)

is_container itself should be MPL boolean instead of type typedef.

Reported by: Yasutaka ATARASHI <atara-y@…> Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: spirit
Version: Boost 1.46.0 Severity: Problem
Keywords: Cc:

Description

Expression Semantics in http://www.boost.org/doc/libs/1_46_1/libs/spirit/doc/html/spirit/advanced/customize/is_container.html says that is_container<C>::type is MPL Boolean Constant.

However, at least, inside boost/spirit/home/qi/detail/pass_container.hpp and boost/spirit/home/karma/detail/pass_container.hpp, is_container<C> itself is used as MPL Boolean Constant, like traits::is_container<RHSAttribute>::value.

NOTE: Version field does not have 1.46.1, so I set it to 1.46.0.

Change History (4)

comment:1 by Joel de Guzman, 12 years ago

Owner: changed from Joel de Guzman to Hartmut Kaiser

comment:2 by Hartmut Kaiser, 12 years ago

Sorry I do not understand your problem. boost::spirit::traits::is_container<> is derived from mpl::bool_<> (see $BOOST_ROOT/boost/spirit/home/support/contain.hpp). What's wrong with that?

in reply to:  2 ; comment:3 by anonymous, 12 years ago

Replying to hkaiser:

Sorry I do not understand your problem. boost::spirit::traits::is_container<> is derived from mpl::bool_<> (see $BOOST_ROOT/boost/spirit/home/support/contain.hpp). What's wrong with that?

Sorry for unclarity. Implementation has no problem. The problem point is documentation. is_container is provided for customization point. A reader who wants to provide is_container can misunderstand providing type' is enough, according to the current documentation because "Expression Semantics" only mentions type'.

in reply to:  3 comment:4 by Hartmut Kaiser, 12 years ago

Resolution: worksforme
Status: newclosed

Replying to anonymous:

Replying to hkaiser:

Sorry I do not understand your problem. boost::spirit::traits::is_container<> is derived from mpl::bool_<> (see $BOOST_ROOT/boost/spirit/home/support/contain.hpp). What's wrong with that?

Sorry for unclarity. Implementation has no problem. The problem point is documentation. is_container is provided for customization point. A reader who wants to provide is_container can misunderstand providing type' is enough, according to the current documentation because "Expression Semantics" only mentions type'.

The documentation clearly states that is_container<C>::type has to evaluate to an MPL boolean constant (see expression semantics here: http://www.boost.org/doc/libs/1_46_1/libs/spirit/doc/html/spirit/advanced/customize/is_container.html#spirit.advanced.customize.is_container.expression_semantics).

Note: See TracTickets for help on using tickets.